斯坦福大学机器学习第七讲Lecture7.docx
- 文档编号:24680129
- 上传时间:2023-05-31
- 格式:DOCX
- 页数:11
- 大小:501.87KB
斯坦福大学机器学习第七讲Lecture7.docx
《斯坦福大学机器学习第七讲Lecture7.docx》由会员分享,可在线阅读,更多相关《斯坦福大学机器学习第七讲Lecture7.docx(11页珍藏版)》请在冰豆网上搜索。
斯坦福大学机器学习第七讲Lecture7
Theproblemof
overfitting
MachineLearning
Example:
Linearregression(housingprices
Overfitting:
Ifwehavetoomanyfeatures,thelearnedhypothesistogeneralizetonewexamples(predictpricesonnewexamples.
Price
SizePrice
SizePrice
Size
Example:
Logisticregression
(=sigmoidfunction
x
1
x
2
x
1
x
2
x
1
x
2
P
r
i
c
e
Sizesizeofhouse
no.ofbedrooms
no.offloors
ageofhouse
averageincomeinneighborhood
kitchensize
Options:
1.Reducenumberoffeatures.
―Manuallyselectwhichfeaturestokeep.
―Modelselectionalgorithm(laterincourse.
2.Regularization.
―Keepallthefeatures,butreducemagnitude/valuesofparameters.
―Workswellwhenwehavealotoffeatures,eachofwhichcontributesabittopredicting.
Costfunction
MachineLearning
Intuition
Supposewepenalizeandmake,reallysmall.
PriceSizeofhousePrice
Sizeofhouse
Smallvaluesforparameters
―“Simpler”hypothesis
―LesspronetooverfittingHousing:
―Features:
―Parameters:
P
r
ic
eSizeo
fhouse
Whatifissettoanextremelylargevalue(perhapsfortoolargeforourproblem,say?
-Algorithmworksfine;settingtobeverylargecan’thurtit
-Algortihmfailstoeliminateoverfitting.
-Algorithmresultsinunderfitting.(Failstofiteventrainingdatawell.
-Gradientdescentwillfailtoconverge.
Whatifissettoanextremelylargevalue(perhapsfortoolargeforourproblem,say?
Price
Sizeofhouse
Regularizedlinear
regression
MachineLearning
Regularizedlinearregression
Gradientdescent
Repeat
Normalequation
Suppose,
Non-invertibility
(optional/advanced.(#examples(#featuresIf,
Regularized
logisticregression
MachineLearning
Regularizedlogisticregression.x2x1Costfunction:
AndrewNg
GradientdescentRepeatAndrewNg
Advancedoptimizationfunction[jVal,gradient]=costFunction(thetajVal=[codetocompute];];gradient(1=[codetocomputegradient(2=[codetocompute];gradient(3=[codetocompute];gradient(n+1=[codetocompute];AndrewNg
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 斯坦福大学 机器 学习 第七 Lecture7
![提示](https://static.bdocx.com/images/bang_tan.gif)