Supervised Learning (Classification and Regression)
Supervised Learning (Classification and Regression)
Supervised Learning (Classification and Regression)
Linear Models
----------------------------------------------------------------------------------------------------------------------
Algorithm:
Data Program
Computer
Output
Machine Learning:
Data Output
Computer
Program
Tom Mitchell in his book Machine Learning provides a 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.
Experience E- Data
Measure of improvement - P
Learning System:
Here we feed experience, some background knowledge to the learner.
Choose how to represent the target function (appropriate class of functions for different features)
If we choose a Rich Representation then we can solve a complex function but it may be more
difficult to learn.
Class of functions are called Hypothesis Language
Supervised Learning
Acquired XYZ
For example, the inputs could be the weather forecast, and the outputs would be the visitors to the
beach. The goal in supervised learning would be to learn the mapping that describes the
relationship between temperature and number of beach visitors.
Example labelled data is provided of past input and output pairs during the learning process to teach
the model how it should behave, hence, ‘supervised’ learning. For the beach example, new inputs can
then be fed in of forecast temperature and the Machine learning algorithm will then output a future
prediction for the number of visitors.
Being able to adapt to new inputs and make predictions is the crucial generalisation part of machine
learning. In training, we want to maximise generalisation, so the supervised model defines the real
‘general’ underlying relationship. If the model is over-trained, we cause over-fitting to the examples
used and the model would be unable to adapt to new, previously unseen inputs.
A side effect to be aware of in supervised learning that the supervision we provide introduces bias to
the learning. The model can only be imitating exactly what it was shown, so it is very important to
show it reliable, unbiased examples. Also, supervised learning usually requires a lot of data before it
learns. Obtaining enough reliably labelled data is often the hardest and most expensive part of using
supervised learning. (Hence why data has been called the new oil!)
The output from a supervised Machine Learning model could be a category from a finite set e.g [low,
medium, high] for the number of visitors to the beach:
Classification
Classification is used to group the similar data points into different sections in order to classify them.
Machine Learning is used to find the rules that explain how to separate the different data points.
But how are the magical rules created? Well, there are multiple ways to discover the rules. They all
focus on using data and answers to discover rules that linearly separate data points.
Linear separability is a key concept in machine learning. All that linear separability means is ‘can the
different data points be separated by a line?’. So put simply, classification approaches try to find the
best way to separate data points with a line.
The lines drawn between classes are known as the decision boundaries. The entire area that is chosen
to define a class is known as the decision surface. The decision surface defines that if a data point falls
within its boundaries, it will be assigned a certain class.
Classification algorithms can be used in different places. Below are some popular use cases of
Classification Algorithms:
Regression
Regression is another form of supervised learning. The difference between classification and regression
is that regression outputs a number rather than a class. Therefore, regression is useful when predicting
number based problems like stock market prices, the temperature for a given day, or the probability of
an event.
Examples
Regression is used in financial trading to find the patterns in stocks and other assets to decide when to
buy/sell and make a profit.
For classification, it is already being used to classify if an email you receive is spam.
Both the classification and regression supervised learning techniques can be extended to much more
complex tasks. For example, tasks involving speech and audio, image classification, object detection
and chat bots are some examples.
A recent example shown below uses a model trained with supervised learning to realistically fake
videos of people talking.
You might be wondering how this complex image based task relates to classification or regression.
Well, it comes back to everything in the world, even complex phenomenon, being fundamentally
described with math and numbers. In this example, a neural network is still only outputting numbers
like in regression. But in this example the numbers are the numerical 3d coordinate values of a facial
mesh.
Machine learning for regression
Below is a short list of machine learning methods (having their own advantages and disadvantages)
that can be used for regression
Liner regression
Polynomial regression
Ridge regression
Decision trees
SVR (Support Vector Regression)
Random forest
You can find out the detailed explanation of each method here.
In Regression, the output variable must be of In Classification, the output variable must be a
continuous nature or real value. discrete value.
The task of the regression algorithm is to map The task of the classification algorithm is to
the input value (x) with the continuous output map the input value(x) with the discrete output
variable(y). variable(y).
Regression Algorithms are used with Classification Algorithms are used with discrete
continuous data. data.
In Regression, we try to find the best fit line, In Classification, we try to find the decision
which can predict the output more accurately. boundary, which can divide the dataset into
different classes.
Regression algorithms can be used to solve the Classification Algorithms can be used to solve
regression problems such as Weather classification problems such as Identification of
Prediction, House price prediction, etc. spam emails, Speech Recognition, Identification
of cancer cells, etc.
The regression Algorithm can be further The Classification algorithms can be divided
divided into Linear and Non-linear Regression. into Binary Classifier and Multi-class Classifier.