Sogenerallyforif I'm goingtodomachinelearningfirst I doonmydatapreprocessinginpanda's anyways, soit's justconvenienttoknow.
Okay, well, what's thenextstep?
Oncewe'vegotourfeatures, howdowefeeditthrough a model?
Sothat's whatwe'redoinghere.
We'regonnabegrabbing a newdatasetandwe'regonnagrabthediamondsdataset.
Sogoaheadanddownloadthat.
Putitinyourdatasetsdirectory.
Sowhat's ourobjectivegonnabe?
Well, we'regoingtobepredictingthepriceofdiamonds, Sobasically, thistablecontains a bunchofvalueshere.
We'vegot, uh, thecarrotcutcolorclaritydepthtable.
I don't knowwhatthatmeans, butit's tablepercent.
Wegottheprice, the X y Z, whichislengthwithindepthofthatdiamond.
Sothecuriosityiscanwetakeallofthosevaluesexceptforprice, feedthosethrough a regressionmodelandpredictthepriceofthatdiamondsothatinthefuture, whenwegetdiamondsandwedon't knowhowmuchtopayforourdiamondsAh, wecouldjustrunhimthrough a model.
I don't knowhow I justnoticedthatnow, butanyway, letmefixthatrealquick.
456 andseven.
I don't reallywanttopass a valueofzerotomyregressionmodel, if I couldavoidit.
Mean, fixthatin a textbasedversion.
Okay, sonowthatwehavethesewhereyoujustwanttomapthem, uhandso I'm justgonnacomeinhereand I'm goingtosay D uh, cutequals d f cutitdiemap, andthenwejustmapcutclassdicked.
Nowwedefineourclassifier, sosee, leftisgenerallythestandardforclassifierequalsandwe'veimportedSPMalreadyandwilldo S v r andthenwe'llsayColonelequalslinear.
Andagainifyouwanttoseelinearversus I alsorunan r b f, uh, getshavealreadyOh, eclipse.
Umprobablyback.
Yeah.
Alsorunthe I do s o s youraggressor.
I thinkourBFandlinearkernel I can't remember.
I mightonlydorbftobehonest, I can't rememberanyway, ifyouwanttoseesomeyoucancheckthatoutorjustrunityourself.
Seehowyouhowyoudoit.
Anyway, We'regonnagetyou a linearkernel, then, um, Nowwedothetraining, whichiscalledfit.
Sosee, leftoff, notsitfit.
Uh, andthat's extrain.
Whytrain?
Sothatprocessisgonnatake a moment.
So I'm gonnagoaheadandrunthat, and I'm justgonnaglanceoverit.
Makesure I dideverythingrightfor a wasteof a wholebunchoftime.
Reprocesspricevalues, bubblebubblelawvalueshere.
Scalestrain.
Whytrainuptothelast 200?
Andthenthisisthelast 200.
Okay, great.
Sonow, oncewefit a model, we'd liketoknowHowgooddiditdo?
Soyoucoulddothatwithselfdoubt?
Score.
Andwewillscorebasedon X TexTextest.
WhyTestThescoreisgoingtobean r squaredcoefficientofdeterminationinthesenseofbasicallyzeroisbad.
Butotherwise I think I'llpryjustwe'rebasicallydonehere.
But I dowanttoseeyouWhatthathappened.
SoSo, General, what's gonnahappeniswhenwhenyouactuallyusemachinelearningmodelsinpractice, chancesareit's notlike a scenariowhereyou'vegot, like, onemodeltorulethemall.
That's nothowitworks.
Yougenerallywilldosomethingmorelike a votingclassifieroranensembleofclass.
IfIRSsoyou'llhave 59 33 91.
Theclassifierisright.
Youhave a tonofglassfiresandthentheyallwillvotesorinthiscase, theywillallmakepredictions, andyou'lltaketheaveragepredictionorsomethinglikethat.