Machine Learning Foundations, part II

Carlos J. García Carmona
2 min readFeb 24, 2020

--

In the last post, the concept of Machine Learning was introduced, putting it inside AI, explaining the mindset involved, the type of problems it can solve, and the most popular language used for it.

Machine Learning Algorithms

There two main approaches to how a machine can learn: Supervised Learning and Unsupervised Learning. Each one is useful in a different situation or with a different set of data available.

Supervised Learning

We give the machine labelled data, which are enough examples of input data with the expected output (label), letting the machine predict or recognize the output for future inputs. We provide the rules and the machine learns from them.

These types of algorithms can be grouped into regression and classification. In the first one, we want to predict continuous-valued output such as the value of a currency or expected sales of a product, which determines the relationship between variables and the level of dependency between them. There are also two types of regression algorithms:

  • Linear, shown as a straight line in a graph (linear equation).
  • Logistic (non-linear equation).
Linear Regression example from LinkedIn Learning course

In this example of linear regression where we are trying to predict the number of umbrellas sold based on the amount of rainfall, the red line represents the model created by a linear equation, which is:

y = mx + b

Where:

  • y is the prediction (umbrellas sold)
  • x is the variable used to predict (rainfall)
  • m is the slope of the line
  • b is the interception between x and y

With classification algorithms, as the name indicates, we want to classify input data into already predefined output (labels), such as in image recognition or spam email detection.

Unsupervised Learning

We give the machine unlabelled input data and nothing about the expected output, making the machine analyze the inherent structure of the data. One of the most common algorithms of this type is clustering, which groups the inputs into clusters through finding patterns.

Some examples using this approach would be social networks categorizing different news by topics, recommendation systems for shop products, or search engines for similar inputs.

Machine Learning problems checklist

Looking at the types of algorithms applied to ML, we can see that the type of problems we can solve with it require a set of characteristics:

  • Prediction or Classification.
  • Self-containment, because having too many external factors, can hinder an accurate prediction.
  • Labelled data or accessible labels to let the machine learn from previous data.
  • Metric optimization to assess the quality of the model.

If any of these requirements cannot be met by the problem that is being tackled, then ML is not the right solution to solve it.

--

--