Machine Learning by Andrew NG Lecture Notes: Vinod Kumar November 7, 2016
Machine Learning by Andrew NG Lecture Notes: Vinod Kumar November 7, 2016
Machine Learning by Andrew NG Lecture Notes: Vinod Kumar November 7, 2016
Vinod Kumar
November 7, 2016
Introduction
What is Machine Learning
Field of study that gives computers the ability to learn without being ex-
plicitly programmed.
1
An Example: Consider the data set as described in the image above.To
find the price of a new house,from its size we can try to fit a straight through
the data and find out the price of the house based on this straight line.We
can also use a quadratic or a second order polynomial for the same problem
to get a different answer.This is an example of Supervised Learning.
The term supervised learning refers to the fact that we use a data set in
which the right answers were given.In the above example we used a data set
of houses in which for every example in this data set, we told it what is the
right price and the task of the algorithm was just to produce more of these
right answers for new instances.To be a bit more precise the above example
is what we call a regression problem which is a type of supervised problem
where we try to predict a continuous value output.
Unsupervised Learning :-
The term unsupervised learning refers to the fact that we gave the algorithm
a data set in which we only specify the features of the instances and not the
type of the instance.The algorithm should find the structure in the data and
draw conclusions from it.One way to do is to divide the given instances in
the data sets into clusters and when a new instance is given the learning
algorithm can predict which cluster this new instance belongs to.This is
known as clustering algorithm.
An Example: Google news collects many new stories on the web and
groups them together into different categories using this algorithm.This is
done so that all stories about a single incident are grouped together.Also this
technique is used in social network analysis where given knowledge about
which friends you email the most or given your facebook friends or your
Google+ circles, we can automatically identify which are cohesive groups of
friends.
2
ones made by unsupervised learning.This is one example where supervised
learning and unsupervised learning can be used interchangeably.In fact this
is true in most cases.The type of algorithm is mostly chosen according to
the type of data available.
h (x) = 0 + 1 x
Cost Function
There can be many values for 0 and 1 .To find the best possible hypothesis
we use those values which give the least possible cost function.The cost
function generally refers to how close the approximations are to the original
values.In this case the cost function is
m
1 X
J(0 , 1 ) = (h (xi ) yi )
2m
i=1
where xi and yi represent the original size and price of the houses,h (xi )
refers to the hypothesis function.