Sei sulla pagina 1di 4

16/08/2015

LinearRegressionwithOneVariable|Coursera

Linear Regression with One Variable


5questions

1.
Considertheproblemofpredictinghowwellastudentdoesinhersecond
yearofcollege/university,givenhowwelltheydidintheirfirstyear.
Specifically,letxbeequaltothenumberof"A"grades(includingA.Aand
A+grades)thatastudentreceivesintheirfirstyearofcollege(freshmen
year).Wewouldliketopredictthevalueofy,whichwedefineasthe
numberof"A"gradestheygetintheirsecondyear(sophomoreyear).
Questions1through4willusethefollowingtrainingsetofasmallsampleof
differentstudents'performances.Hereeachrowisonetrainingexample.
Recallthatinlinearregression,ourhypothesisish (x) = 0
weusemtodenotethenumberoftrainingexamples.

+ 1 x

,and

Forthetrainingsetgivenabove,whatisthevalueofm?Intheboxbelow,
pleaseenteryouranswer(whichshouldbeanumberbetween0and10).
Help Center

2.
https://www.coursera.org/learn/machinelearning/exam/QeJ50/linearregressionwithonevariable

1/4

16/08/2015

LinearRegressionwithOneVariable|Coursera

Manysubstancesthatcanburn(suchasgasolineandalcohol)havea
chemicalstructurebasedoncarbonatomsforthisreasontheyarecalled
hydrocarbons.Achemistwantstounderstandhowthenumberofcarbon
atomsinamoleculeaffectshowmuchenergyisreleasedwhenthat
moleculecombusts(meaningthatitisburned).Thechemistsobtainsthe
datasetbelow.Inthecolumnontheright,kJ/molistheunitmeasuringthe
amountofenergyreleased.

Youwouldliketouselinearregression(h (x) = 0

+ 1 x

)toestimatethe

amountofenergyreleased(y)asafunctionofthenumberofcarbonatoms
(x).Whichofthefollowingdoyouthinkwillbethevaluesyouobtainfor0
and1 ?Youshouldbeabletoselecttherightanswerwithoutactually
implementinglinearregression.
0 = 569.6, 1 = 530.9

0 = 569.6, 1 = 530.9

0 = 1780.0, 1 = 530.9

0 = 1780.0, 1 = 530.9

3.
Supposeweset0

= 1, 1 = 0.5

.Whatish (4)?

https://www.coursera.org/learn/machinelearning/exam/QeJ50/linearregressionwithonevariable

2/4

16/08/2015

LinearRegressionwithOneVariable|Coursera

4.
Letf besomefunctionsothat
f (0 , 1 )

outputsanumber.Forthisproblem,

issomearbitrary/unknownsmoothfunction(notnecessarilythe

costfunctionoflinearregression,sof mayhavelocaloptima).
Supposeweusegradientdescenttotrytominimizef (0 , 1 )
asafunctionof0 and1 .Whichofthe
followingstatementsaretrue?(Checkallthatapply.)
Ifthelearningrateistoosmall,thengradientdescentmaytakea
verylong
timetoconverge.
If0 and1 areinitializedat
alocalminimum,thenoneiterationwillnotchangetheirvalues.
If0 and1 areinitializedsothat0

= 1

,thenbysymmetry

(becausewedosimultaneousupdatestothetwoparameters),
afteroneiterationofgradientdescent,wewillstillhave0 = 1 .
Evenifthelearningrateisverylarge,everyiterationof
gradientdescentwilldecreasethevalueoff (0 , 1 ) .

5.
Supposethatforsomelinearregressionproblem(say,predictinghousing
pricesasinthelecture),we
havesometrainingset,andforourtrainingsetwemanagedtofindsome
0 ,1 suchthatJ (0 , 1 ) = 0 .Which
ofthestatementsbelowmustthenbetrue?(Checkallthatapply.)
https://www.coursera.org/learn/machinelearning/exam/QeJ50/linearregressionwithonevariable

3/4

16/08/2015

LinearRegressionwithOneVariable|Coursera

Forthistobetrue,wemusthave0

= 0

and1

= 0

sothath (x) = 0
Forthistobetrue,wemusthavey (i)
i = 1, 2, , m

= 0

foreveryvalueof

Gradientdescentislikelytogetstuckatalocalminimumandfail
tofindtheglobalminimum.
Ourtrainingsetcanbefitperfectlybyastraightline,
i.e.,allofourtrainingexampleslieperfectlyonsomestraightline.

1questionunanswered
SubmitQuiz

(https://accounts.coursera.org/i/zendesk/courserahelp?return_to=https://learner.coursera.help/hc)

https://www.coursera.org/learn/machinelearning/exam/QeJ50/linearregressionwithonevariable

4/4

Potrebbero piacerti anche