











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












Machine Learning
Example: Linear regression (housing prices) Overfi&ng: If we have too many features, the learned hypothesis may fit the training set very well ( ), but fail to generalize to new examples (predict prices on new Price Size Price Size Price Size
Addressing overfi&ng: Price Size size of house no. of bedrooms no. of floors age of house average income in neighborhood kitchen size
Addressing overfi&ng: Op*ons:
Intui3on Suppose we penalize and make , really small. Price Size of house Price Size of house
Small values for parameters ― “Simpler” hypothesis ― Less prone to overfi6ng Regulariza3on. Housing: ― Features: ― Parameters:
In regularized linear regression, we choose to minimize What if is set to an extremely large value (perhaps for too large for our problem, say )? Price Size of house
Machine Learning
Gradient descent Repeat
Normal equa3on
Machine Learning
Cost func*on: x 1 x 2
gradient(1) = [ ]; function [jVal, gradient] = costFunction(theta) jVal = [ ]; gradient(2) = [ ]; gradient(n+1) = [ ]; code to compute code to compute code to compute code to compute Advanced op3miza3on gradient(3) = [ code to compute ];