Model selection

d=degree.of.polynomidd = degree .of .polynomid
d=1,hθ(x)=θ0+θ1xd=1,h_{\theta}(x)=\theta_0 +\theta_1x
d=2,hθ(x)=θ0+θ1x+θ2xd=2,h_{\theta}(x)=\theta_0 +\theta_1x+\theta_2x
d=3,hθ(x)=θ0+θ1x+θ2x+θ3x3d=3,h_{\theta}(x)=\theta_0 +\theta_1x+\theta_2x+\theta_3x^{3}
d=10,hθ(x)=θ0+θ1x+θ2x+θ3x3......θ10x10d=10 ,h_{\theta}(x)=\theta_0 +\theta_1x+\theta_2x+\theta_3x^{3}......\theta_10x^{10}

Then calculate everyone Θ(d)\Theta^{(d)}–>Jtest(Θ(d))J_{test}(\Theta^{(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=1m(hθ(x(i))y(i))2J_{train}(\theta)=1/2m \displaystyle \sum^{m}_{i=1}(h_{\theta}(x^{(i)})-y^{(i)})^2
Jcv(θ)=1/2mcvi=1mcv(hθ(x(i))y(i))2J_{cv}(\theta)=1/2m_{cv} \displaystyle \sum^{m_{cv}}_{i=1}(h_{\theta}(x^{(i)})-y^{(i)})^2
Jtest(θ)=1/2mtesti=1mtest(hθ(x(i))y(i))2J_{test}(\theta)=1/2m_{test} \displaystyle \sum^{m_{test}}_{i=1}(h_{\theta}(x^{(i)})-y^{(i)})^2

Diagnosing bias vs. variance

9.24(2)

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
9.24(2)
9.24(2)

  • 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,etcx_1^2,x_2^2,x_1,x_2,etc)(fixes high bias)
  • Try decreasing λ\lambda( fix high bias)
  • Try increasing λ\lambda( fix high variance)

相关文章:

  • 2021-10-16
  • 2021-06-19
  • 2021-10-22
  • 2021-09-22
  • 2021-12-14
  • 2021-05-11
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2021-07-05
  • 2021-10-29
  • 2021-10-21
  • 2021-07-09
  • 2022-01-06
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案