Supervised, Unsupervised and Semi-Supervised Learning

Anuja Lamahewa
5 min readOct 9, 2023

--

Supervised and unsupervised learning are two core components in building machine learning models.

So, what’s the difference?

Supervised Learning

supervised learning, which uses labelled input and output data, while an unsupervised learning model doesn’t.

But what does that really mean?

Now, in supervised learning, the machine learning algorithm is trained on a labelled dataset. So, this means that for each example in the training dataset, the algorithm knows what the correct output is, and the algorithm uses this knowledge to try to generalize to new examples that it’s never seen before. Thus, using labelled inputs and outputs, the model can measure its accuracy and learn over time.

Supervised learning can be divided into a couple of subcategories.

Classification

Firstly, there is a category of classification and classification talks about whether the output is a discrete class label such as “spam” or “not spam”. Linear classifiers, support vector machines, or SPMs, decision trees, and random forests which all common examples of classification algorithms.

Regression

The other example is regression. The output here is a continuous value, such as price or probability. Linear regression and logistic regression are two common types of regression algorithms.

Unsupervised Learning

Now, unsupervised learning is where the machine learning algorithm is not really given any labels at all, and these algorithms discover hidden patterns in data without the need for human intervention. They’re unsupervised.

Unsupervised learning models are used for three main tasks, such as clustering, association, and dimensionality reduction. So, let’s take a look at each one of those, starting with clustering.

Clustering

Clustering is where the algorithm groups similar experiences together. So, a common application of clustering is customer segmentation, where businesses might group customers together based on similarities like, I don’t know, age or location or spending habits, something like that.

Association

And association is where the algorithm looks for relationships between variables in the data. Association rules are often used in market basket analysis, where businesses want to know which items are often bought together. You know, something along the lines of, “Customers who bought this item also bought “, that sort of thing.

Dimensional Reduction

And this is where the algorithm reduces the number of variables in the data, while still preserving as much of the information as possible. Often this technique is used in the pre-processing data stage, such as when autoencoders remove noise from visual images to improve picture quality.

Differences between these two types of learning

Okay, so let’s talk about the differences between these two types of learning.

In supervised learning, the algorithm learns from training datasets by iteratively making predictions on the data and then adjusting for the correct answer.

While supervised learning models tend to be more accurate than unsupervised learning models,

they do require all this up-front human intervention to label the data appropriately. For example, a supervised learning model can predict how long your commute will be on the time of day and think about the weather conditions and so forth but first, you’ll have to train it to know things like rainy weather extends the driving time.

By contrast, unsupervised learning models work on their own to discover the inherent structure of unlabelled data. These models don’t need humans to intervene. They can automatically find patterns in data and group them together.

So, for example, an unsupervised learning model can cluster images by the objects they contain things like people and animals and buildings without being told what those objects were ahead of time.

Now, an important distinction to make is that unsupervised learning models don’t make predictions. They only group data together. So if you were to use an unsupervised learning model on that same commute dataset, it would group together commutes with similar conditions like the time of day and the weather, but it wouldn’t be able to predict how long each commute would take.

Okay, so which of these two options is right for you?

In general, supervised learning is more commonly used than unsupervised learning and that’s really because it’s more accurate and efficient, that being said, unsupervised learning has its own advantages. There are two that I can think of.

Firstly, unsupervised learning can be used on data that is not labelled, which is often the case in real-world datasets.

And then secondly, unsupervised learning can be used to find hidden patterns in data that supervised learning models just wouldn’t find.

Classifying big data can be a real challenge in supervised learning, but the results are highly accurate and trustworthy in contrast, unsupervised learning can handle large volumes of data in real-time but there’s a lack of transparency into how that data is clustered and a high risk given accurate results.

But wait, it is not an “either/or” choice.

May I present to you the middle ground known as semi-supervised learning:

Semi-Supervised Learning

This is, well, a happy medium where you use a training data set with both labelled and unlabelled data. It’s particularly useful when it’s difficult to extract relevant features from data when you have a high volume of data. So, for example, you could use a semi-supervised learning algorithm on a data set with millions of images where only a few thousand of those images are labelled.

Semi-supervised learning is ideal for medical images, where a small amount of training data could lead to a significant improvement in accuracy. For example, a radiologist can look at and label some small subset of CT scans for tumours or diseases, and then the machine can more accurately predict which patients might require more medical attention without going through and labelling the entire set.

--

--