FAFU機(jī)器學(xué)習(xí)08-2 Ensemble Learning課件_第1頁(yè)
FAFU機(jī)器學(xué)習(xí)08-2 Ensemble Learning課件_第2頁(yè)
FAFU機(jī)器學(xué)習(xí)08-2 Ensemble Learning課件_第3頁(yè)
FAFU機(jī)器學(xué)習(xí)08-2 Ensemble Learning課件_第4頁(yè)
FAFU機(jī)器學(xué)習(xí)08-2 Ensemble Learning課件_第5頁(yè)
已閱讀5頁(yè),還剩42頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

FoundationsofMachineLearning

EnsembleLearning(集成學(xué)習(xí))Top10algorithmsindataminingC4.5K-MeansSVMAprioriEM(MaximumLikelihood)PageRankAdaBoostKNNNa?veBayesCARTEnsembleLearningIntroductionCommonlyusedensemblelearningalgorithmsBaggingRandomforestBoostingsklearn.ensemble:EnsembleMethods2023/11/4EnsembleLearningLesson7-3IntroductionSomeonewantstoinvestinacompanyXYZ.Heisnotsureaboutitsperformancethough.So,helooksfor

adviceonwhetherthestockpricewillincreasemorethan6%perannumornot?Hedecidestoapproachvarious

expertshavingdiversedomainexperience:

EmployeeofCompanyXYZ:

right70%times.FinancialAdvisorofCompanyXYZ:

right75%times.StockMarketTrader:

right70%times.Employeeofacompetitor:

right60%times.MarketResearchteaminsamesegment:

right75%times.SocialMediaExpert:

right65%times.2023/11/4EnsembleLearningLesson7-4IntroductionSomeonewantstoinvestinacompanyXYZ.Heisnotsureaboutitsperformancethough.So,helooksfor

adviceonwhetherthestockpricewillincreasemorethan6%perannumornot?Hedecidestoapproachvarious

expertshavingdiversedomainexperience:

Inascenariowhenallthe6experts/teamsverifythat

it’sagooddecision(assumingallthepredictionsareindependentofeachother),wewillgetacombinedaccuracyrateof:1-30%*25%*30%*40%*25%*35%=99.92125%2023/11/4EnsembleLearningLesson7-5DefinitionEnsemblelearningisamachinelearningparadigmwheremultiplelearnersaretrainedtosolvethesameproblem.Also,calledmulti-classifiersystem(多分類器系統(tǒng)),orcommittee-basedlearning(基于委員會(huì)的學(xué)習(xí)).Incontrasttoordinarymachinelearningapproacheswhichtrytolearnonehypothesisfromtrainingdata,ensemblemethodstrytoconstructasetofhypothesisandcombinethemtouse2023/11/4EnsembleLearningLesson7-6Definition2023/11/4EnsembleLearningLesson7-7DefinitionIndividuallearners(個(gè)體學(xué)習(xí)器)areanumberoflearnersusedinanensembleBaselearners(基學(xué)習(xí)器)theindividuallearnersthatareusuallygeneratedfromtrainingdatabyasinglebaselearningalgorithmtoproduceahomogeneousensemble.Componentlearners(組件學(xué)習(xí)器)theindividuallearnersthatareusuallygeneratedfromtrainingdatabymultiplelearningalgorithmtoproduceaheterogeneousensemble.2023/11/4EnsembleLearningLesson7-8DefinitionWeaklearnersOnlyslightlybetterthanrandomguessErrorRate:

<50%MosttheoreticalanalysesworkweaklearnersStronglearnersRendersclassificationofarbitraryaccuracyErrorRate:

isarbitrarilysmallEnsemblelearningisappealingbecausethatisabletoboostweaklearnerstostronglearnersBycombiningdiverseofweaklearners2023/11/4EnsembleLearningLesson7-9DefinitionEnsemblelearningisappealingbecausethatisabletoboostweaklearnerstostronglearnersBycombiningdiverseofweaklearners2023/11/4EnsembleLearningLesson7-10Ensemblelearningisprimarilyusedtoimprovethe(classification,prediction,functionapproximation,etc.)performanceofamodel,orreducethelikelihoodofanunfortunateselectionofapoorone.Otherapplicationsofensemblelearningincludeassigningaconfidencetothedecisionmadebythemodel,selectingoptimal(ornearoptimal)features,datafusion,incrementallearning,nonstationarylearninganderror-correcting.2023/11/4EnsembleLearningLesson7-11ScenariosforusingensemblelearningModelSelection--Whatisthemostappropriateclassifierforagivenclassificationproblem?whattypeofclassifiershouldbechosenamongmanycompetingmodels,suchas

multilayerperceptron

(MLP),

supportvectormachines

(SVM),

decisiontrees,

naiveBayesclassifier,etc;givenaparticularclassification

algorithm,whichrealizationofthisalgorithmshouldbechosen-forexample,differentinitializationsofMLPscangiverisetodifferentdecisionboundaries,evenifallotherparametersarekeptconstant.

2023/11/4EnsembleLearningLesson7-12ScenariosforusingensemblelearningToomuchortoolittledataWhentheamountoftrainingdataistoolargetomakeasingleclassifiertrainingdifficult,thedatacanbestrategicallypartitionedintosmallersubsets.Eachpartitioncanthenbeusedtotrainaseparateclassifierwhichcanthenbecombinedusinganappropriatecombinationrule.Whenthereistoolittledata,thenbootstrapping

canbeusedtotraindifferentclassifiersusingdifferentbootstrapsamples

ofthedata,whereeachbootstrapsampleisarandomsampleofthedatadrawnwithreplacementandtreatedasifitwasindependentlydrawnfromtheunderlyingdistribution.2023/11/4EnsembleLearningLesson7-13ScenariosforusingensemblelearningDivideandConquerCertainproblemsarejusttoodifficultforagivenclassifiertosolve.2023/11/4EnsembleLearningLesson7-14ScenariosforusingensemblelearningDataFusionInmanyapplicationsthatcallforautomateddecisionmaking,itisnotunusualtoreceivedataobtainedfromdifferentsourcesthatmayprovidecomplementaryinformation.Asuitablecombinationofsuchinformationisknownas

dataorinformationfusion,

andcanleadtoimprovedaccuracyoftheclassificationdecisioncomparedtoadecisionbasedonanyoftheindividualdatasourcesalone.Theseheterogeneousfeaturescannotbeusedalltogethertotrainasingleclassifier(andeveniftheycould-byconvertingallfeaturesintoavectorofscalarvalues-suchatrainingisunlikelytobesuccessful).Insuchcases,anensembleofclassifierscanbeused,whereaseparateclassifieristrainedoneachofthefeaturesetsindependently.Thedecisionsmadebyeachclassifiercanthenbecombinedbyanyofthecombinationrulesdescribedbelow.2023/11/4EnsembleLearningLesson7-15ScenariosforusingensemblelearningConfidenceEstimationTheverystructureofanensemblebasedsystemnaturallyallowsassigningaconfidencetothedecisionmadebysuchasystem.Ifavastmajorityoftheclassifiersagreewiththeirdecisions,suchanoutcomecanbeinterpretedastheensemblehavinghighconfidenceinitsdecision.If,however,halftheclassifiersmakeonedecisionandtheotherhalfmakeadifferentdecision,thiscanbeinterpretedastheensemblehavinglowconfidenceinitsdecision.2023/11/4EnsembleLearningLesson7-16WhyensemblessuperiortosinglesSuppose,theerrorofbaselearnersAnensemblewithvotingcanbepresentedasTheerroroftheensembleis2023/11/4EnsembleLearningLesson7-17MethodsforconstructingensemblesSubsamplingthetrainingexamplesMultiplehypothesesaregeneratedbytrainingindividualclassifiersondifferentdatasetsobtainedbyresamplingacommontrainingset.ManipulatingtheinputfeatureMultiplehypothesesaregeneratedbytrainingindividualclassifiersondifferentrepresentations,ordifferentsubsetsofacommonfeaturevectorManipulatingtheoutputtargetsTheoutputtargetsforCclassesareencodedwithanL-bitcodeword,andanindividualclassifierisbuilttopredicteachoneofthebitsinthecodewordModifyingthelearningparametersoftheclassifierAnumberofclassifiersarebuiltwithdifferentlearningalgorithms,suchasnumberofneighborsinaKNNrule,initialweightsinanMPL.2023/11/4EnsembleLearningLesson7-18EnsemblecombinationrulesAlgebraiccombiners(代數(shù)結(jié)合)Algebraiccombinersare

non-trainablecombiners,wherecontinuousvaluedoutputsofclassifiersarecombinedthroughanalgebraicexpression.2023/11/4EnsembleLearningLesson7-19EnsemblecombinationrulesAlgebraiccombinersVotingbasedmethodsVotingbasedmethodsoperateonlabelsonlyMajority(plurality)votingWeightedmajorityvoting2023/11/4EnsembleLearningLesson7-20EnsemblecombinationrulesAlgebraiccombinersVotingbasedmethodsOthercombinationrules

Bordacount

behaviorknowledgespace

(Huang1993)"decisiontemplates"(Kuncheva2001)

Dempster-Schaferrule

(Kittler1998).Foradetailedoverviewoftheseandothercombinationrules,see(L.I.Kuncheva,CombiningPatternClassifiers,MethodsandAlgorithms.NewYork,NY:WileyInterscience,2005.).2023/11/4EnsembleLearningLesson7-21EnsembleLearningIntroductionCommonlyusedensemblelearningalgorithmsBaggingRandomforestBoostingsklearn.ensemble:EnsembleMethods2023/11/4EnsembleLearningLesson7-22CommonlyusedensemblelearningalgorithmsBagging(

bootstrap(自展法)aggregating)isoneoftheearliest,mostintuitiveandperhapsthesimplestensemblebasedalgorithmsBaggingcreatesanensemblebytrainingindividualclassifiersonbootstrapsamplesofthetrainset.Buildaclassifieroneachbootstrapsample2023/11/4EnsembleLearningLesson7-232023/11/4EnsembleLearningLesson7-242023/11/4EnsembleLearningLesson7-25H1H2H3H4SamplingN’exampleswithreplacementSet1Set2Set3Set4(usuallyN=N’)Ntrainingexamples2023/11/4EnsembleLearningLesson7-26y1H1H2H3H4y2y3y4Average/votingTestingdataxThisapproachwouldbehelpfulwhenyourmodeliscomplex,easytooverfit.e.g.decisiontreeTheperturbationinthetrainingsetduetothebootstrapresamplingcausesdifferenthypothesestobebuilt,particularlyiftheclassifierisunstableAclassifierissaidtobeunstableifasmallchangeinthetrainingdata(e.g.orderofpresentationofexample)canbeleadtoaradicallydifferenthypothesis.E.g.decisiontrees,neuralnetwork,logisticsregressionBaggingreducesvarianceIfasingleclassifierisunstable,thatis,ithashighvariance2023/11/4EnsembleLearningLesson7-27BaggingreducesvarianceIfasingleclassifierisunstable,thatis,ithashighvarianceBaggingworkswellforunstablelearningalgorithms.Baggingcanslightlydegradetheperformanceofstablelearningalgorithms.Baggingalmostalwayshelpswithregression,butevenwithunstablelearners,itcanhurtinclassification.2023/11/4EnsembleLearningLesson7-28RandomforestRandomForestsareanimprovement

overbaggeddecisiontrees.AproblemwithdecisiontreeslikeCARTisthattheyaregreedy.Theychoosewhichvariabletosplitonusingagreedyalgorithmthatminimizeserror.Assuch,evenwithBagging,thedecisiontreescanhavealotofstructuralsimilaritiesandinturnhavehighcorrelationintheirpredictions.Combiningpredictionsfrommultiplemodelsinensemblesworksbetterifthepredictionsfromthesub-modelsareuncorrelatedoratbestweaklycorrelated.2023/11/4EnsembleLearningLesson7-29RandomforestRandomForestsareanimprovement

overbaggeddecisiontrees.Randomforestchangesthealgorithmforthewaythatthesub-treesarelearnedsothattheresultingpredictionsfromallofthesubtreeshavelesscorrelation.Therandomforestalgorithmchangesthisproceduresothatthelearningalgorithmislimitedtoarandomsampleoffeaturesofwhichtosearch.2023/11/4EnsembleLearningLesson7-30RandomforestRandomForestsareanimprovement

overbaggeddecisiontrees.Motivation:reduceerrorcorrelationbetweenclassifiersMainidea:buildalargernumberofun-pruneddecisiontreesKey:usingarandomselectionoffeaturestosplitonateachnode(使用隨機(jī)選擇的特征子集來(lái)選擇最佳分割特征)2023/11/4EnsembleLearningLesson7-31RandomforestHowRandomforestworksEachtreeisgrownonabootstrapsampleofthetrainingsetofNexamples.AnumbermisspecifiedmuchsmallerthanthetotalnumberofvariablesM(e.g.m=sqrt(M)).Ateachnode,mvariablesareselectedatrandomoutoftheM.Thesplitusedisthebestsplitonthesemvariables.Finalclassificationisdonebymajorityvoteacrosstrees.2023/11/4EnsembleLearningLesson7-32gcForestDeepForest:TowardsAnAlternativetoDeepNeuralNetworksgcForest采用了cascade的結(jié)構(gòu),每層接受特征信息,經(jīng)過(guò)處理后傳給下一層。每一層都是一個(gè)決策樹(shù)深林的總體,也就是由多個(gè)隨機(jī)深林組成。隨機(jī)深林的類型越多越好。論文中給定的有兩種類型的隨機(jī)深林,藍(lán)色表示randomforests,黑色表示complete-randomtreeforests。2023/11/4EnsembleLearningLesson7-33gcForestDeepForest:TowardsAnAlternativetoDeepNeuralNetworksIncontrasttodeepneuralnetworkswhichrequiregreateffortinhyper-parametertuning,gcForestismucheasiertotrain;evenwhenitisappliedtodifferentdataacrossdifferentdomainsinourexperiments,excellentperformancecanbeachievedbyalmostsamesettingsofhyper-parameters.ThetrainingprocessofgcForestisefficient,anduserscancontroltrainingcostaccordingtocomputationalresourceavailable.TheefficiencymaybefurtherenhancedbecausegcForestisnaturallyapttoparallelimplementation.Furthermore,incontrasttodeepneuralnetworkswhichrequirelargescaletrainingdata,gcForestcanworkwellevenwhenthereareonlysmall-scaletrainingdata.。2023/11/4EnsembleLearningLesson7-34PerformanceofgcForestImageCategorizationFaceRecognitionMusicClassificationHandMovementRecognition…2023/11/4EnsembleLearningLesson7-35gcForest

Officialimplementationforthepaper'Deepforest:Towardsanalternativetodeepneuralnetworks'Pythonimplementationofdeepforestmethod:gcForest2023/11/4EnsembleLearningLesson7-36BoostingBoosting

isa

machinelearningensemble

meta-algorithm

forprimarilyreducing

bias,andalsovariancein

supervisedlearning,andafamilyofmachinelearningalgorithmswhichconvertweaklearnerstostrongones.Boosting

alsocreatesanensembleofclassifiersbyresamplingthedata,whicharethencombinedbymajorityvotinginboosting,resamplingisstrategicallygearedtoprovidethemostinformativetrainingdata(最具信息的訓(xùn)練數(shù)據(jù),即前面分類器預(yù)測(cè)錯(cuò)誤的訓(xùn)練數(shù)據(jù))foreachconsecutiveclassifier2023/11/4EnsembleLearningLesson7-37Boosting[Schapire,1989]2023/11/4EnsembleLearningLesson7-38AdaBoostAdaBoost

(AdaptiveBoosting)extendsboostingtomulti-classandregressionproblems.

usingre-weightinsteadofresampling,andadaptivelyweigheachdataexample.Dataexampleswhicharewronglyclassifiedgethighweight(thealgorithmwillfocusonthem)Eachboostingroundlearnsanew(simple)classifierontheweigheddataset.Theseclassifiersareweighedtocombinethemintoasinglepowerfulclassifier.2023/11/4EnsembleLearningLesson7-392023/11/4EnsembleLearningLesson7-40EnsembleLearningIntroductionCommonlyusedensemblelearningalgorithmsBaggingRandomforestBoostingsklearn.ensemble:EnsembleMethods2023/11/4EnsembleLearningLesson7-41sklearn.ensemble:EnsembleMethodsThe

sklearn.ensemble

moduleincludesensemble-basedmethodsforclassification,regressionandanomalydetection.2023/11/4EnsembleLearningLesson7-42ensemble.AdaBoostClassifier([…])AnAdaBoostclassifier.ensemble.AdaBoostRegressor([base_estimator,

…])AnAdaBoostregressor.ensemble.BaggingClassifier([base_estimator,

…])ABaggingclassifier.ensemble.BaggingRegressor([base_estimator,

…])ABaggingregressor.ensemble.RandomForestClassifier([…])Arandomforestclassifier.ensemble.RandomForestRegressor([…])Arandomforestregressor.ensemble.RandomTreesEmbedding([…])Anensembleoftotallyrandomtrees.ensemble.VotingClassifier(estimators[,

…])SoftVoting/MajorityRuleclassifierforunfittedestimators.sklearn.ensemble:EnsembleMethodsclass

sklearn.ensemble.BaggingClassifier(base_estimator=None,

n_estimators=10,

max_samples=1.0,

max_features=1.0,

bootstrap=True,

bootstrap_features=False,

oob_score=False,

warm_start=False,

n_jobs=None,

random_state=None,

verbose=0)Thisalgorithmencompassesseveralworksfromtheliterature.Whenrandomsubsetsofthedatasetaredrawnasrandomsubsetsofthesamples,thenthisalgorithmisknownasPasting

[1].Ifsamplesaredrawnwithreplacement,thenthemethodisknownasBagging

[2].Whenrandomsubsetsofthedatasetaredrawnasrandomsubsetsofthefeatures,thenthemethodisknownasRandomSubspaces

[3].Finally,whenbaseestimatorsarebuiltonsubsetsofbothsamplesandfeatures,thenthemethodisknownasRandomPatches

[4].2023/11/4EnsembleLearningLesson7-43sklearn.ensemble:EnsembleMethodsclass

sklearn.ensemble.RandomForestClassifier(n_estimators=’warn’,

criterion=’gini’,

max_depth=None,

min_samples_split=2,

min_samples_leaf=1,

min_weight_fraction_leaf=0.0,

max_features=’auto’,

max_

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論