Model selection
d=degree.of.polynomid
d=1,hθ(x)=θ0+θ1x
d=2,hθ(x)=θ0+θ1x+θ2x
d=3,hθ(x)=θ0+θ1x+θ2x+θ3x3
d=10,hθ(x)=θ0+θ1x+θ2x+θ3x3......θ10x10
Then calculate everyone Θ(d)–>Jtest(Θ(d)),to choose the most reasonable one
But the problem still live in ,when new training set appear.
- In order to get around this problem ,we’re going to do is split it into 3 pieces
(Testing set60%, Cross validation set20% , Test set20%)
Jtrain(θ)=1/2mi=1∑m(hθ(x(i))−y(i))2
Jcv(θ)=1/2mcvi=1∑mcv(hθ(x(i))−y(i))2
Jtest(θ)=1/2mtesti=1∑mtest(hθ(x(i))−y(i))2
Diagnosing bias vs. variance

Regularization and bias/variance(正则化和偏差、方差)
taking about how it interacts with and is effected by the regularization of your learning algorithm
learning curves(学习曲线)
If a learning algorithm is suffering from high bias, getting more training data will not (by itself) help much


- Get more training examples(fixes high variance)
- Try smaller sets of features(fixes high variance)
- Try getting additional features(fixes high bias)
- Try adding polynomial features(x12,x22,x1,x2,etc)(fixes high bias)
- Try decreasing λ( fix high bias)
- Try increasing λ( fix high variance)