Machine Learning-Andrew Ng 课程第六周——Advice for Applying Machine Learning

版权声明: https://blog.csdn.net/Dr_destiny/article/details/82989154

这一周的课程没涉及什么特别“硬”的知识,都是在说如何使学习算法表现得更好,但是这些知识也很重要,有助于提高“软”实力,特别是在调试算法的时候,尤其有帮助。

1. Learning Curve和Validation Curve

所谓的Learning Curve就是指参数theta分别在training set和validation set上的error随训练集规模变化的曲线,其他的不多说,就说一点在编程时需要注意的地方:在计算training error和validation error时, λ \lambda 值需要设置为0。也就是说,在计算这两个error的时候,是不加正则项的,用社区助教的话来说,就是:

We want to measure the error in the hypothesis, without including any additional penalties for the theta values.
Regularization is built-in to theta when you train the system. We do not need to include it twice. When we measure J t r a i n J_{train} , J c v J_{cv} , and J t e s t J_{test} , we want to measure the true error, without any additional penalties.

2. quiz的一道题

原题是判断对错,有一个选项比较迷,这里贴出来:

It is okay to use data from the test set to choose the regularization parameter λ, but not the model parameters.

这个选项应该是错误的。

模型参数和正则化参数 λ \lambda 都是通过validation set选出来的。

猜你喜欢

转载自blog.csdn.net/Dr_destiny/article/details/82989154