Andrew Ng Machine Learning 第六周
Andrew Ng Machine Learning 第六周
前言
网易云课堂(双语字幕,不卡):https://study.163.com/course/courseMain.htm?courseId=1004570029
Coursera:https://www.coursera.org/learn/machine-learning
本人初学者,先在网易云课堂上看网课,再去Coursera上做作业,开博客以记录,文章中引用图片皆为课程中所截。
为了人工智能!
为了人工智能!为了人工智能!
为了人工智能!为了人工智能!为了人工智能!
应用机器学习的建议
1.决定下一步做什么
Tips: 讲训练集 随机 分割成两份,一份负责计算出理想的J(θ)然后最小化,再用得出的结果同样方法计算验证Jtest(θ)
2.模型选择和训练、验证、测试集
Tips: 决定hθ(x)的次数
Tips: 将训练集随机分成三部分,先计算训练集上最初始的J(θ),将J(θ)得出来的θ代入交叉集即图中第二部分来验证J(θ),来定下多项式的次数,最后在测试集上测试它的泛化能力
3.诊断偏差与方差
Tips: 简单理解上就是欠拟合或者参数不够即为高偏差,过拟合即为高方差
4.正则化和偏差、方差
Tips: 在模型选择那一步上加上了正则项
5.学习曲线
Tips: 训练集小的时候,能简单符合要求,当训练集越来越大的时候,代价函数将会越来越大之后变于平稳,因为hθ(x)已无法更好的满足要求了
Tips: 训练集小的时候,不能满足泛化要求,越来越多的训练集时,同上hθ(x)已无法更好的满足要求了,显然,两个代价函数都很大,但是增加训练集已经基本不会变化了
6.决定接下来做什么
Tips: 高偏差情况,可以理解为λ过大或者特征参数过少而欠拟合,此时,减小λ,增加特征参数。而高方差情况,可以理解为λ过小或者特征参数过多而过拟合,此时,增大λ,增加训练集,减少特征参数。
题目
1.Question 1
You train a learning algorithm, and find that it has unacceptably high error on the test set. You plot the learning curve, and obtain the figure below. Is the algorithm suffering from high bias, high variance, or neither?
解答:C
2.Question 2
Suppose you have implemented regularized logistic regression
to classify what object is in an image (i.e., to do object
recognition). However, when you test your hypothesis on a new
set of images, you find that it makes unacceptably large
errors with its predictions on the new images. However, your
hypothesis performs well (has low error) on the
training set. Which of the following are promising steps to
take? Check all that apply.
解答:B
3.Question 3
Suppose you have implemented regularized logistic regression
to predict what items customers will purchase on a web
shopping site. However, when you test your hypothesis on a new
set of customers, you find that it makes unacceptably large
errors in its predictions. Furthermore, the hypothesis
performs poorly on the training set. Which of the
following might be promising steps to take? Check all that
apply.
解答:AC
4.Question 4
Which of the following statements are true? Check all that apply.
解答:BC
5.Question 5
Which of the following statements are true? Check all that apply.
解答:ACD