Supervised Learning: Week 1
Supervised Learning: Week 1
Supervised Learning
Supervised Learning
In supervised learning, we are given a data set and already know what
our correct output should look like, having the idea that there is a
relationship between the input and the output.
Example 1:
Given data about the size of houses on the real estate market, try to
predict their price. Price as a function of size is a continuous output, so
this is a regression problem.
Example 2:
Unsupervised Learning
Unsupervised learning allows us to approach problems with little or no idea what our results
should look like. We can derive structure from data where we don't necessarily know the effect of
the variables.
We can derive this structure by clustering the data based on relationships among the variables in
the data.
Example:
Clustering: Take a collection of 1,000,000 different genes, and find a way to automatically group
these genes into groups that are somehow similar or related by different variables, such as
lifespan, location, roles, and so on.
Non-clustering: The "Cocktail Party Algorithm", allows you to find structure in a chaotic
environment. (i.e. identifying individual voices and music from a mesh of sounds at a cocktail
party).
Cost Function
We can measure the accuracy (độ chính xác) of our hypothesis function by using a cost
function. This takes an average difference (actually a fancier version of an average) of all the
results of the hypothesis with inputs from x's and the actual output y's.
1
To break it apart, it is x́ where x́ is the mean of the squares of hθ ( x i )− y i , or the difference
2
between the predicted value and the actual value.
This function is otherwise called the "Squared error function", or "Mean squared error". The
1
mean is halved ( ) as a convenience for the computation of the gradient descent (độ dốc
2
1
xuống), as the derivative (đạo hàm) term of the square function will cancel out the ( ) term. The
2
following image summarizes what the cost function does: