Supervised vs. Unsupervised Learning: what's the difference?
Supervised vs. Unsupervised Learning: what's the difference?
As humans, we have many different ways we learn things. The way you learned calculus, for example, is probably not the same way you learned to stack blocks. The way you learned the alphabet is probably wildly different from the way you learned how to tell if objects are approaching you or going away from you. The latter you might not even realize you learned at all!
Similarly, when we think about making programs that can learn, we have to think about these programs learning in different ways. Two main ways that we can approach machine learning areSupervised LearningandUnsupervised Learning. Both are useful for different situations or kinds of data available.
What is supervised learning?
Let’s imagine you’re first learning about different genres in music. Your music teacher plays you an indie rock song and says “This is an indie rock song”. Then, they play you a K-pop song and tell you “This is a K-pop song”. Then, they play you a techno track and say “This is techno”. You go through many examples of these genres.
The next time you’re listening to the radio, and you hear techno, you may think “This is similar to the 5 techno tracks I heard in class today. This must be techno!”
Even though the teacher didn’t tell you aboutthistechno track, she gave you enough examples of songs that were techno, so you could recognize more examples of it.
When we explicitly tell a program what we expect the output to be, and let it learn the rules that produce expected outputs from given inputs, we are performing supervised learning.
Supervised Learning GIF
A common example of this isimage classification. Often, we want to build systems that will be able to describe a picture. To do this, we normally show a program thousands of examples of pictures, with labels that describe them. During this process, the program adjusts its internal parameters. Then, when we show it a new example of a photo with an unknown description, it should be able to produce a reasonable description of the photo.
When you complete aCaptchaand identify the images that have cars, you’re labeling images! A supervised machine learning algorithm can now use those pictures that you’ve tagged to make it’s car-image predictor more accurate.
What is unsupervised learning?
Let’s say you are an alien who has been observing the meals people eat. You’ve embedded yourself into the body of an employee at a typical tech startup, and you see people eating breakfasts, lunches, and snacks. Over the course of a couple weeks, you surmise that for breakfast people mostly eat foods like:
- Cereals
- Bagels
- Granola bars
Lunch is usually a combination of:
- Some sort of vegetable
- Some sort of protein
- Some sort of grain
Snacks are usually a piece of fruit or a handful of nuts. No one explicitlytoldyou what kinds of foods go with each meal, but you learned from natural observation and put the patterns together. In unsupervised learning, we don’t tell the program anything about what we expect the output to be. The program itself analyzes the data it encounters and tries to pick out patterns and group the data in meaningful ways.
Unsupervised Learning
An example of this includesclusteringto create segments in a business’s user population. In this case, an unsupervised learning algorithm would probably create groups (or clusters) based on parameters that a human may not even consider.
Conclusion
We have gone over the difference between supervised and unsupervised learning:
- Supervised Learning: Data is labeled, and the program learns to predict the output from the input data
- Unsupervised Learning: Data is unlabeled, and the program learns to recognize the inherent structure in the input data
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Complete Payment to Unlock Full Guide & Source Code
You are viewing the 30% preview. Join TopCourseAI Pro to unlock the remaining 70% of this article, unblur all code snippets, and gain full access to all 412 technical projects and guides.
Ready to access the complete step-by-step tutorial?
Gain full unhindered access to all 412 technical projects and guides, unblur all source code snippets, and download runnable scripts.
Related Blueprints & Guides
View all 166 →Decision Trees for Classification and Regression
Decision trees are a common type of machine learning model used for binary classification tasks. The natural structure of a binary tree lends itself well to predicting a “yes” or “no” target. It is traversed sequentially...
Machine learningFeature Importance
When we fit a supervised machine learning (ML) model, we often want to understand which features are most associated with our outcome of interest. Features that are highly associated with the outcome are considered more...
Machine learningHistory of Chatbots
In October of 1950, Alan Turing proposed an approach for evaluating a computer’s intelligence and famously named his method, The Imitation Game. The premise is that an interrogator talks to two people through a “typewrit...
Ready to build production-grade AI systems?
Enjoyed this guide? Continue exploring our library of 166+ production blueprints, multi-agent swarms, and autonomous agent systems with 100% unblurred, executable source code.