斯坦福大学机器学习第七讲Lecture7.docx

上传人:b****5 文档编号:24680129 上传时间:2023-05-31 格式:DOCX 页数:11 大小:501.87KB
下载 相关 举报
斯坦福大学机器学习第七讲Lecture7.docx_第1页
第1页 / 共11页
斯坦福大学机器学习第七讲Lecture7.docx_第2页
第2页 / 共11页
斯坦福大学机器学习第七讲Lecture7.docx_第3页
第3页 / 共11页
斯坦福大学机器学习第七讲Lecture7.docx_第4页
第4页 / 共11页
斯坦福大学机器学习第七讲Lecture7.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

斯坦福大学机器学习第七讲Lecture7.docx

《斯坦福大学机器学习第七讲Lecture7.docx》由会员分享,可在线阅读,更多相关《斯坦福大学机器学习第七讲Lecture7.docx(11页珍藏版)》请在冰豆网上搜索。

斯坦福大学机器学习第七讲Lecture7.docx

斯坦福大学机器学习第七讲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模板 > 自然景观

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1