Subtitles section Play video
So supervised learning algorithms learn to predict input-output or x-to-y mappings.
And in the last video, you saw that regression algorithms, which is a type of supervised learning algorithm, learns to predict numbers out of infinitely many possible numbers.
There's a second major type of supervised learning algorithm called a classification algorithm.
Let's take a look at what this means.
Take breast cancer detection as an example of a classification problem.
Say you're building a machine learning system so that doctors can have a diagnostic tool to detect breast cancer.
This is important because early detection could potentially save a patient's life.
Using a patient's medical records, your machine learning system tries to figure out if a tumor, that is a lump, is malignant, meaning cancerous or dangerous, or if that tumor, that lump, is benign, meaning that it's just a lump that isn't cancerous and isn't that dangerous.
Some of my friends have actually been working on this specific problem.
So maybe your dataset has tumors of various sizes, and these tumors are labeled as either benign, which I will designate in this example with a zero, or malignant, which I'll designate in this example with a one.
You can then plot your data on a graph like this, where the horizontal axis represents the size of the tumor, and the vertical axis takes on only two values, zero or one, depending on whether the tumor is benign, zero, or malignant, one.
One reason that this is different from regression is that we're trying to predict only a small number of possible outputs or categories.
In this case, two possible outputs, zero or one, benign or malignant.
This is different from regression, which tries to predict any number out of an infinitely many number of possible numbers.
So the fact that there are only two possible outputs is what makes this classification.
Because there are only two possible outputs or two possible categories in this example, you can also plot this dataset on a line like this, where now I'm going to use two different symbols to denote the category, using a circle or an O to denote the benign examples, and a cross to denote the malignant examples.
If a new patient walks in for a diagnosis and they have a lump that is this size, then the question is, will your system classify this tumor as benign or malignant?
It turns out that in classification problems, you can also have more than two possible output categories.
Maybe your learning algorithm can output multiple types of cancer diagnoses if it turns out to be malignant.
So let's call two different types of cancer, type 1 and type 2.
In this case, the algorithm would have three possible output categories it could predict.
By the way, in classification, the terms output classes and output categories are often used interchangeably.
So when I say class or category, when referring to the output, it means the same thing.
So to summarize, classification algorithms predict categories.
Categories don't have to be numbers, it could be non-numeric.
For example, it can predict whether a picture is that of a cat or a dog, and it can predict if a tumor is benign or malignant.
Categories can also be numbers like 0 or 1 or 0 or 1 or 2.
But what makes classification different from regression when you're interpreting the numbers is that classification predicts a small, finite, limited set of possible output categories such as 0, 1, and 2, but not all possible numbers in between like 0.5 or 1.7.
In the example of supervised learning that we've been looking at, we had only one input value, the size of the tumor.
But you can also use more than one input value to predict an output.
Here's an example.
Instead of just knowing the tumor size, say you also have each patient's age in years.
Your new dataset now has two inputs, age and tumor size.
Plotting this new dataset, we're going to use circles to show patients whose tumors are benign, and crosses to show the patients with a tumor that was malignant.
So when a new patient comes in, the doctor can measure the patient's tumor size, and also record the patient's age.
So given this, how can we predict if this patient's tumor is benign or malignant?
Well, given a dataset like this, what the learning algorithm might do is find some boundary that separates out the malignant tumors from the benign ones.
So the learning algorithm has to decide how to fit a boundary line to this data.
The boundary line found by the learning algorithm would help the doctor with the diagnosis.
In this case, the tumor is more likely to be benign.
From this example, we've seen how two inputs, the patient's age and tumor size, can be used.
In other machine learning problems, often many more input values are required.
My friends who worked on breast cancer detection use many additional inputs like the thickness of the tumor clump, uniformity of the cell size, uniformity of the cell shape, and so on.
So to recap, supervised learning maps input X to output Y, where the learning algorithm learns from the quote, right answers.
The two major types of supervised learning are regression and classification.
In a regression application, like predicting prices of houses, the learning algorithm has to predict numbers from infinitely many possible output numbers, whereas in classification, the learning algorithm has to make a prediction of a category out of a small set of possible outputs.
So you now know what is supervised learning, including both regression and classification.
I hope you're having fun.
Next, there's a second major type of machine learning called unsupervised learning.
Let's go on to the next video to see what that is.