in Machine Learning 2nd Edition
Exercise Solutions by Simon
Rogers and Nark Girolami
,SOLUTIONS MANUAL FOR
N N
A First Course In
N N N N
Machine Learning N N
(2Nd Edition) Exe
N N
rcise SolutionsN
by
Simon Rogers andMark
N N N N
Girolami
BocaNRatonN LondonN NewNYork
CRCNPressNisNanNimprintNofNthe
TaylorN&NFrancisNGroup,NanNinformaNbusiness
,CRCNPress
TaylorN&NFrancisNGroup
6000N BrokenN SoundN ParkwayN NW,N SuiteN 300N
BocaNRaton,NFLN33487-2742
©N2017NbyNTaylorN&NFrancisNGroup,NLLC
CRCNPressNisNanNimprintNofNTaylorN&NFrancisNGroup,NanNInformaNbu
sinessNNoNclaimNtoNoriginalNU.S.NGovernmentNworks
PrintedN onN acid-
freeN paperNVersionNDate:N
20160404
InternationalN StandardN BookN Number-13:N 978-1-4987-3859-0N (Ancillary)
ThisNbookNcontainsNinformationNobtainedNfromNauthenticNandNhighlyNregardedNsources.NReasonableNeffortsNhaveNbeenNmadeNtoNpublishNreliableN
dataNandNinformation,NbutNtheNauthorNandNpublisherNcannotNassumeNresponsibilityNforNtheNvalidityNofNallNmaterialsNorNtheNconsequencesNofNthei
rNuse.NTheNauthorsNandNpublishersN haveN attemptedN toN traceN theN copyrightN holdersN ofN allN materialN reproducedN inN thisN publicationN andN apologi
zeN toN copyrightN holdersN ifN permissionNtoNpublishNinNthisNformNhasNnotNbeenNobtained.NIfNanyNcopyrightNmaterialNhasNnotNbeenNacknowledgedNp
leaseNwriteNandNletNusNknowNsoNweNmayNrectifyNinNanyNfutureNreprint.
ExceptNasNpermittedNunderNU.S.NCopyrightNLaw,NnoNpartNofNthisNbookNmayNbeNreprinted,Nreproduced,Ntransmitted,NorNutilizedNinNanyNformNby
NanyNelectronic,Nmechanical,NorN otherNmeans,NnowNknownNor NhereafterNinvented,N includingNphotocopying,N microfilming,NandNrecording, N orNin Nan
yNinformationNstorageNorNretrieval Nsystem,NwithoutNwrittenNpermissionNfromNtheNpublishers.
ForN permissionN toN photocopyN orN useN materialN electronicallyN fromN thisN work,N pleaseN accessN www.copyright.comN (http://www.copyright.com/)N
orN contactNtheNCopyrightNClearanceNCenter,NInc.N(CCC),N222NRosewoodNDrive,NDanvers,NMAN01923,N978-750-8400.NCCCNisNaNnot-for-
profitNorganizationNthatNprovidesNlicensesNandNregistrationNforNaNvarietyNofNusers.NForNorganizationsNthatNhaveNbeenNgrantedNaNphotocopyNlicens
eNbyNtheNCCC,NaNseparateNsystemNofNpaymentNhasNbeenNarranged.
TrademarkN Notice:N ProductN orN corporateN namesN mayN beN trademarksN orN registeredN trademarks,N andN areN usedN onlyN forN identificationN andN e
xplanationNwithoutNintentNtoNinfringe.
VisitN theN TaylorN &N FrancisN WebN si
teN atNhttp://www.taylorandfrancis.c
om
andN theN CRCN PressN WebN sit
eN atNhttp://www.crcpress.co
m
, Chapter 1 N
EXN 1.1.N AN highN positiveN valueN ofN w0N andN aN smallN negativeN valueN forN w1.N TheseN reflec
tN theNhighN interceptN onN theN tN axisN (correspondingN toN theN theoreticalN timeN winnin
gN timeN atNxN=N0N andN theN smallN decreseN inN winningN timeN overN theN years.
EXN1.2.N TheN followingN wouldN doNtheNjob:
1 %NAttributesNareNstoredNinNNx1NvectorNx
2 %NTargetsNareNstoredNinNNx1NvectorNtNxbN
3 =Nmean(x);
4 tbN=Nmean(t);
5 x2bN=Nmean(x.*x);N
6 xtbN=Nmean(x.*t);
7 w1N =N (xtbN−Nxt*xb)/(x2b−xbˆ2);
8 w0N=Ntb−w1*xb;
9 %NPlotNtheNdataNplot(x,t,'b.','marke
10 rsize',25);
11 %NPlotNtheNmodelNh
12 oldNon;
13 plot(x,w0+w1*x,'r','linewidth',2);
EXN 1.3.N WeN needN toN findN wTXTXw.N We’llN startN withN XTX.N MultiplyingN XTN byN XNgives:
N
ΣN ΣN
T 2
x n1
n=1NN n=1 xn1xn2
XN XN= ΣN ΣN
n=1
xn2 xn1 x2n2
n=1NNN
MultiplyingN thisN byN wN gives:
Σ Σ
T w0 N N 2N +Nw N
1 xn1xn2
n=1 xn1
Σ N N n=1
w0 n=1 xn2 xn1 1+Nw Σ x
N 2
XN XwN= n=1NNN n2
1