Machine Learning: Supervised or Unsupervised?

Pedro Barros
Analytics Vidhya
4 min readSep 21, 2020

--

The use case of machine learning ranges from games to fraud detection to statistical analysis of the stock exchange. It is used to build systems like Netflix and Spotify that recommend music and/or videos to users based on their access history, favorites, and other data, or systems that find all similar news articles on a given day. It can also be used to automatically categorize Web pages according to gender (sports, economics, politics, well-being, and so on) or to mark e-mail messages as spam. The uses of machine learning are more numerous than I can address in this post and several machine learning approaches are used to solve the most diverse problems. In this post, I’ll focus on the two most commonly used — supervised and unsupervised learning.

First I will start with the definition of Machine Learning:

Arthur Samuel described it as: “field of study that gives computers the ability to learn without being explicitly programmed”, which is an older informal definition.

Tom Mitchell provides a more modern definition:

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.

Example: Playing checkers

E = The experience of playing many checkers
T = The task of playing checkers.
P = The probability that the program will win the next game.

Supervised Learning

We are given a set of labeled data that we already know which is our correct output and that must be similar to the set, having the idea that there is a relationship between the input and the output.

Supervised learning problems are classified as “regression” and “classification” problems. In a regression problem, we are trying to predict the results on a continuous output, which means that we are trying to map input variables to some continuous function. In a classification problem, we are trying to predict the results in a discrete output. In other words, we are trying to map input variables into different categories.

Example 1:

Given a set of data on the size of houses in the real estate market, try to predict their price. Price based on size is a continuous output, so this is a regression problem.

We could also turn this example into a classification problem, and instead of doing our production on whether the house “is sold for more or less than the asking price.” Here we are classifying homes based on price into two distinct categories.

Example 2:

Regression: Given an image of a man/woman, we have to predict their age based on image data.

Classification: Given an example of a cancerous tumor, we have to predict whether it is benign or malignant by its size and the patient’s age.

Classification and Regression Example

Another example of a Classification widely used by banks is the decision to accept the loan for a customer based on their credit history.

Many algorithms are used to create supervised learners, the most common being Neural Networks, Support Vector Machines (SVMs), and Naive Bayes Classifiers.

Unsupervised learning

Unsupervised learning, on the other hand, allows us to approach problems with little or no idea of what our results should look like. We can derive data structure where we would not necessarily know the effect of the variables.

We can derive this structure by grouping the data based on relationships between the variables in the data. It can also be used to reduce the number of dimensions in a data set to focus only on the most useful attributes or to detect trends.

In Unsupervised Learning there is no feedback based on the results of the forecast, that is, there is no teacher to correct it.

Example 1:

Clustering: Given a collection of 1000 searches from a university find a way to automatically group these searches into groups that are somehow similar or related by different variables, such as the frequency of words, phrases, page count, etc.

Example 2:

Another non-clustering example is the “Cocktail Party Algorithm”, which can find in a disorganized data structure how to identify individual voices and music.

Common unsupervised learning approaches include storage in K-means, Hierarchical Cluster, and Self-Organizing Maps.

Example of different learning approaches

An example of a project that implements machine learning in a simplistic way is Apache Mahout which aims to build an environment for the rapid creation of scalable, high-performance machine learning applications.

To close this post with a flourish, I leave the following sentence by Daniel Keys Moran:

You can have data without information, but you cannot have information without data.

Well, it’s all for today folks, leave your comments and see you next time !!!

--

--