ML_Note:bias VS variance
来源:互联网 发布:java bigdecimal 相加 编辑:程序博客网 时间:2024/06/17 15:56
这次主要总结一下,如何诊断学习曲线,如何判断我们进行拟合数据的时候是处于高偏差(bias),还是处于刚方差 (variance).以及我们应该采取的行动.
Deciding What to Try Next
Errors in your predictions can be troubleshooted by:
1、Getting more training examples
2、Trying smaller sets of features
3、Trying additional features
4、Trying polynomial features
5、Increasing or decreasing λ
Evaluating a Hypothesis
我们怎么才知道我们所做的模型是好还是坏呢? 我们可以这样做把训练数据(train set)分为两部分,一部分是作为训练集(train set),一部分作为测试集(test set).我们从训练集中训练数据,然后把的到的
对于线性回归来说,
对于分类(classifier),logistic 回归问题来说,
Model Selection and Train/Validation/Test Sets
仅仅只是因为在测试集上的误差最小还说明不了什么问题,有可能你选着的模型都是错的,所以我们需要用一些方法选择一个好的模型。
交叉验证方法
我们引入第3个集合交叉验证集(cross validation set),来寻找最优的模型,对于线性回归来说我们需要找到一个比较优化的次数(degree),当然也可以不用这个(cross validation set),而直接采用(test set),不过这样的化,test set 的误差就是经过优化了的,所以不建议使用这种方式.
With the Validation Set (note: this method presumes we do not also use the CV set for regularization)
1、Optimize the parameters in Θ using the training set for each polynomial degree.
2、Find the polynomial degree d with the least error using the cross validation set.
3、Estimate the generalization error using the test set with
Jtest(Θ(d)) , (d = theta from >polynomial with lower error);
This way, the degree of the polynomial d has not been trained using the test set.
所有的验证集合的误差计算的时候都是不需要加入正则化参数(
Diagnosing Bias vs. Variance
对于高偏差(bias)与高方差(Variance),可以这样想,当次数
Regularization and Bias/Variance
这个再讲正则化(regression)的时候是有讲到的.
正则化的一般步骤
for i = 1:length(lambda_vec) lambda = lambda_vec(i); [theta] = trainLinearReg(X,y,lambda); error_train(i) = linearRegCostFunction(X,y,theta,0); error_val(i) = linearRegCostFunction(Xval,yval,theta,0);end;
Learning Curves
我们画出
Deciding What to Do Next Revisited
参考
链接 week 6
- ML_Note:bias VS variance
- Bias vs. variance
- Diagnosing Bias vs. Variance
- 第六周---Bias. vs Variance
- bias & variance
- Bias-Variance Tradeoff
- bias和variance
- Bias Variance Tradeoff
- Bias and Variance Tradeoff
- Bias-Variance Tradeoff
- bias和variance
- 关于bias 和 variance
- bias和variance
- bias and variance
- Bias and Variance
- bias和variance
- Bias Variance Tradeoff
- bias和variance
- myeclipse 中 svn 更新 提交 同步资源库 详细解释下他们的功能
- 详细分析一下MaxTenuringThreshold在虚拟机垃圾回收中作用及内存分配过程
- Lucene全文检索学习总结
- Gradle项目中文乱码的解决办法
- Html5 API之Notification对象实现桌面通知
- ML_Note:bias VS variance
- Myeclipse10 优化设置
- JNI基础(三)第一个小程序,java调C
- 修改.gitignore不生效的解决办法
- 循环队列有关操作
- 解决myeclipse打开jsp页面慢的问题
- 构建高性能微服务架构(网易)
- LINK1123: failure during conversion to COFF
- 【erlang】【位语法】【Bit Syntax】