Bias Variance
Bias Variance
Minati Rath
Example: Linear regression (housing prices)
Fitting a linear function
Fitting a quadratic function
Price
Size
Bias vs. variance in linear regression
Price
Size
Overfitting
If we have too many features, the learned hypothesis may fit the
training set very well
Approach 2
– Divide data into train set (60%), validation set
(20%) and test set (20%)
– Select that hypothesis which gives lowest error on
validation set
– Use test set to estimate generalization error
Intuition of regularization
Price
Price
Size of house
Size of house
By convention, regularization is
not applied on θ0 (makes little
difference to the solution)
λ: Regularization parameter