December19,2015
TypePackageTitleGradientBoostingVersion0.3-11Date2015-12-07
AuthorZhuWang[aut,cre],
TorstenHothorn[ctb]
MaintainerZhuWang DescriptionFunctionalgradientdescentalgorithmforavarietyofconvexandnonconvexlossfunc-tions,forbothclassicalandrobustregressionandclassificationproblems.HingeBoostisimple-mentedforbinaryandmulti-classclassification,withunequalmisclassificationcostsforbi-narycase.Thealgorithmcanfitlinearandnonlinearclassifiers.Importsrpart,methods,foreach,doParallelDependsgbmSuggestshdi,pROCLicenseGPL(>=2)LazyLoadyesNeedsCompilationnoRepositoryCRAN Date/Publication2015-12-1911:01:59 Rtopicsdocumented: bst-package.bst......bst.sel....bst_control.cv.bst....cv.mada...cv.mbst...cv.mhingebstcv.mhingeova .......................................................................................................................................1.........................................................................................................................................................................................................................2.2.5.6.8.9.10.11.12 2 ex1data..loss....mada....mbst....mhingebst.mhingeova.nsel....rbst....rbstpath..rmbst... Index .......................................................................................................................................................................................................................................................................................................................................................................................................................... bst1314141518192122232427 bst-packageBoostingforClassificationandRegression Description Gradientdescentboostingforhingelossandsquareerrorloss.Details Package:Type:Version:Date:License:LazyLoad: bst Package0.1 2010-04-15GPL-2yes Author(s) ZhuWang bstBoostingforClassificationandRegression Description Gradientboostingforoptimizinghingeorsquarederrorlossfunctionswithcomponentwiselinear,smoothingsplines,treemodelsasbaselearners. bstUsage 3 bst(x,y,cost=0.5,family=c(\"gaussian\\"hinge\\"hinge2\\"binom\\"expo\ \"poisson\\"tgaussianDC\\"thingeDC\\"tbinomDC\\"binomdDC\\"texpoDC\\"tpoissonDC\\"huber\\"thuberDC\"),ctrl=bst_control(),control.tree=list(maxdepth=1),learner=c(\"ls\\"sm\\"tree\"))##S3methodforclassbstprint(x,...) ##S3methodforclassbst predict(object,newdata=NULL,newy=NULL,mstop=NULL, type=c(\"response\\"all.res\\"class\\"loss\\"error\"),...)##S3methodforclassbst plot(x,type=c(\"step\\"norm\"),...)##S3methodforclassbst coef(object,which=object$ctrl$mstop,...)##S3methodforclassbst fpartial(object,mstop=NULL,newdata=NULL)Arguments xycostfamily adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbein{1,-1}forfamily=\"hinge\". pricetopayforfalsepositive,0 acharacterspecifyingthecomponent-wisebaselearnertobeused:lslinearmodels,smsmoothingsplines,treeregressiontrees.classofbst. newdataforpredictionwiththesamenumberofcolumnsasx.newresponse. boostingiterationforprediction. atwhichboostingmstoptoextractcoefficients.additionalarguments. ctrltype control.treelearnerobjectnewdatanewymstopwhich...Details Boostingalgorithmsforclassificationandregressionproblems.Inaclassificationproblem,supposefisaclassifierforareponsey.Acost-sensitiveorweightedlossfunctionis L(y,f,cost)=l(y,f,cost)max(0,(1−yf)) 4 Forfamily=\"hinge\", l(y,f,cost)=1−cost,ify=+1; cost,ify=−1 bst Forfamily=\"hinge2\",l(y,f,cost)=1,ify=+1andf>0;=1-cost,ify=+1andf<0;=cost,ify=-1andf>0;=1,ify=-1andf<0. Fortwinboostingiftwinboost=TRUE,therearetwotypesofadaptiveboostingiflearner=\"ls\":fortwintype=1,weightsarebasedoncoefficientsinthefirstroundofboosting;fortwintype=2,weightsarebasedonpredictionsinthefirstroundofboosting.SeeBuehlmannandHothorn(2010).Value Anobjectofclassbstwithprint,coef,plotandpredictmethodsareavailableforlinearmodels.Fornonlinearmodels,methodsprintandpredictareavailable.x,y,cost,family,learner,control.tree,maxdepth Theseareinputvariablesandparametersctrlyhatensml.fitensemblexselectcoefAuthor(s) ZhuWangReferences ZhuWang(2011),HingeBoost:ROC-BasedBoostforClassificationandVariableSelection.TheInternationalJournalofBiostatistics,7(1),Article13. PeterBuehlmannandTorstenHothorn(2010),TwinBoosting:improvedfeatureselectionandpre-diction,StatisticsandComputing,20,119-138.SeeAlso cv.bstforcross-validatedstoppingiteration.Furthermoreseebst_control theinputctrlwithpossibleupdatedfkiffamily=\"thingeDC\\"tbinomDC\\"binomdDC\"predictedfunctionestimates alistoflengthmstop.Eachelementisafittedmodeltothepsedoresiduals,definedasnegativegradientoflossfunctionatthecurrentestimatedfunctionthelastelementofens avectoroflengthmstop.Eachelementisthevariableselectedineachboostingstepwhenapplicableselectedvariablesinmstop estimatedcoefficientsineachiteration.Usedinternallyonly bst.selExamples x<-matrix(rnorm(100*5),ncol=5)c<-2*x[,1] p<-exp(c)/(exp(c)+exp(-c))y<-rbinom(100,1,p)y[y!=1]<--1 x<-as.data.frame(x) dat.m<-bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")predict(dat.m) dat.m1<-bst(x,y,ctrl=bst_control(twinboost=TRUE, coefir=coef(dat.m),xselect.init=dat.m$xselect,mstop=50)) dat.m2<-rbst(x,y,ctrl=bst_control(mstop=50,s=0,trace=TRUE),rfamily=\"thinge\learner=\"ls\")predict(dat.m2) 5 bst.selFunctiontoselectnumberofpredictors Description Functiontodeterminethefirstqpredictorsintheboostingpath,orperform(10-fold)cross-validationanddeterminetheoptimalsetofparametersUsage bst.sel(x,y,q,type=c(\"firstq\\"cv\"),...)Arguments xyqtype...Details Functiontodeterminethefirstqpredictorsintheboostingpath,orperform(10-fold)cross-validationanddeterminetheoptimalsetofparameters.Thismaybeusedforp-valuecalculation.Seebelow.Value Vectorofselectedpredictors.Author(s) ZhuWang Designmatrix(withoutintercept). Continuousresponsevectorforlinearregression Maximumnumberofpredictorsthatshouldbeselectediftype=\"firstq\".iftype=\"firstq\",returnthefirstqpredictorsintheboostingpath.iftype=\"cv\",perform(10-fold)cross-validationanddeterminetheoptimalsetofparametersFurtherargumentstobepassedtobst,cv.bst. 6Examples ##Notrun: x<-matrix(rnorm(100*100),nrow=100,ncol=100)y<-x[,1]*2+x[,2]*2.5+rnorm(100)sel<-bst.sel(x,y,q=10)library(\"hdi\") fit.multi<-hdi(x,y,method=\"multi.split\model.selector=bst.sel, args.model.selector=list(type=\"firstq\q=10))fit.multi fit.multi$pval[1:10]##thefirst10p-valuesfit.multi<-hdi(x,y,method=\"multi.split\model.selector=bst.sel, args.model.selector=list(type=\"cv\"))fit.multi fit.multi$pval[1:10]##thefirst10p-values##End(Notrun) bst_control bst_controlControlParametersforBoosting Description Specificationofthenumberofboostingiterations,stepsizeandotherparametersforboostingalgo-rithms.Usage bst_control(mstop=50,nu=0.1,twinboost=FALSE,twintype=1,threshold=c(\"standard\\"adaptive\"),f.init=NULL,coefir=NULL, xselect.init=NULL,center=FALSE,trace=FALSE,numsample=50,df=4, s=NULL,sh=NULL,q=NULL,qh=NULL,fk=NULL,iter=10,intercept=FALSE)Arguments mstopnutwinboosttwintype anintegergivingthenumberofboostingiterations. asmallnumber(between0and1)definingthestepsizeorshrinkageparameter.alogicalvalue:TRUEfortwinboosting. fortwinboost=TRUEonly.Forlearner=\"ls\",iftwintype=1,twinboostingwithweightsfrommagnitudeofcoefficientsinthefirstroundofboosting.Iftwintype=2,weightsarecorrelationsbetweenpredictedvaluesinthefirstroundofboostingandcurrentpredictedvalues.Forlearnersnotcomponentwiseleastsquares,twintype=2. ifthreshold=\"adaptive\",theestimatedfunctionctrl$fkisupdatedineveryboostingstep.Otherwise,noupdateforctrl$fkinboostingsteps.Onlyusedifinrobustlossfunctionswiththedifferenceconvexloss. threshold bst_control f.initcoefirxselect.initcentertracenumsampledfs,q 7 theestimatefromthefirstroundoftwinboosting.Onlyusefulwhentwinboost=TRUEandlearner=\"sm\"or\"tree\". theestimatedcoefficientsfromthefirstroundoftwinboosting.Onlyusefulwhentwinboost=TRUEandlearner=\"ls\". thevariableselectedfromthefirstroundoftwinboosting.Onlyusefulwhentwinboost=TRUE. alogicalvalue:TRUEtocentercovariateswithmean. alogicalvalueforprintoutofmoredetailsofinformationduringthefittingpro-cess. numberofrandomsamplevariableselectedinthefirstroundoftwinboosting.Thisispotentiallyusefulinthefutureimplementation.degreeoffreedomusedinsmoothingsplines. truncationparametersorfrequencyqofoutliersforrobustregressionandclas-sification.Ifsismissingbutqisavailable,smaybecomputedasthe1-qquantileofrobustlossvaluesusingconventionalsoftware. thresholdvalueorfrequencyqhofoutliersforHuberregressionnfamily=\"huber\"orfamily=\"rhuberDC\".Forfamily=\"huber\",ifshisnotprovided,shisthenupdatedadaptivelywiththemedianofy-yhatwhereyhatistheestimatedyinthelastboostingiteration.Forfamily=\"rhuberDC\",ifshismissingbutqhisavailable,shmaybecomputedasthe1-qhquantileofrobustlossvaluesusingconventionalsoftware. usedforrobustclassification.Afunctionestimateusedindifferenceofconvexalgorithm numberofiterationindifferenceofconvexalgorithm logicalvalue,ifTRUE,estimationofinterceptwithlinearpredictormodel sh,qh fkiterinterceptDetails Objectstospecifyparametersoftheboostingalgorithmsimplementedinbst,viathectrlargu-ment.Thedefaultvalueofsis-1iffamily=\"thinge\",-log(3)iffamily=\"tbinom\",and4iffamily=\"binomd\"Value Anobjectofclassbst_control,alist.Notefkmaybeupdatedforrobustboosting.SeeAlso bst 8cv.bst cv.bstCross-ValidationforBinaryHingeBoost Description Cross-validatedestimationoftheempiricalriskforboostingparameterselection.Usage cv.bst(x,y,K=10,cost=0.5,family=c(\"gaussian\\"hinge\\"hinge2\\"binom\\"expo\ \"poisson\\"tgaussianDC\\"thingeDC\\"tbinomDC\\"binomdDC\\"texpoDC\\"tpoissonDC\"),learner=c(\"ls\\"sm\\"tree\"),ctrl=bst_control(),type=c(\"risk\\"misc\"),plot.it=TRUE,se=TRUE,n.cores=2,...)Arguments xyKcostfamily adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbein{1,-1}forfamily=\"hinge\".K-foldcross-validation pricetopayforfalsepositive,0 cross-validationcriteria.Forfamily=\"hinge\",type=\"risk\"ishingeriskandtype=\"misc\"ismisclassificationerror.Forfamily=\"gaussian\",onlyempiri-calrisks. alogicalvalue,toplottheestimatedrisksifTRUE.alogicalvalue,toplotwithstandarderrors. ThenumberofCPUcorestouse.Thecross-validationloopwillattempttosenddifferentCVfoldsofftodifferentcores.additionalarguments. learnerctrltype plot.itse n.cores...Value objectwithresidmatmstopcv cv.errorfamily... empiricalrisksineachcross-validationatboostingiterationsboostingiterationstepsatwhichCVcurveshouldbecomputed.TheCVcurveateachvalueofmstopThestandarderroroftheCVcurve family=\"hinge\"forhingelossandfamily=\"gaussian\"forsquarederrorloss. cv.madaSeeAlso bstExamples 9 ##Notrun: x<-matrix(rnorm(100*5),ncol=5)c<-2*x[,1] p<-exp(c)/(exp(c)+exp(-c))y<-rbinom(100,1,p)y[y!=1]<--1 x<-as.data.frame(x) cv.bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"lsype=\"risk\")cv.bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"lsype=\"misc\")dat.m<-bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")dat.m1<-cv.bst(x,y,ctrl=bst_control(twinboost=TRUE,coefir=coef(dat.m),xselect.init=dat.m$xselect,mstop=50),family=\"hinge\learner=\"ls\")##End(Notrun) cv.madaCross-Validationforone-vs-allAdaBoostwithmulti-classproblem Description Cross-validatedestimationoftheempiricalmisclassificationerrorforboostingparameterselection.Usage cv.mada(x,y,balance=FALSE,K=10,nu=0.1,mstop=200,interaction.depth=1,trace=FALSE,plot.it=TRUE,se=TRUE,...)Arguments adatamatrixcontainingthevariablesinthemodel. vectorofmulticlassresponses.ymustbeanintergervectorfrom1toCforCclassproblem. balancelogicalvalue.IfTRUE,TheKpartswereroughlybalanced,ensuringthatthe classesweredistributedproportionallyamongeachoftheKparts. KK-foldcross-validationnuasmallnumber(between0and1)definingthestepsizeorshrinkageparameter.mstopnumberofboostingiteration.interaction.depth usedingbmtospecifythedepthoftrees. traceifTRUE,iterationresultsprintedout.plot.italogicalvalue,toplotthecross-validationerrorifTRUE.sealogicalvalue,toplotwith1standarddeviationcurves....additionalarguments.xy 10Value objectwithresidmatfractioncvcv.error...SeeAlso mada empiricalrisksineachcross-validationatboostingiterationsabscissavaluesatwhichCVcurveshouldbecomputed.TheCVcurveateachvalueoffractionThestandarderroroftheCVcurve cv.mbst cv.mbstCross-ValidationforMulti-classBoosting Description Cross-validatedestimationoftheempiricalmulti-classlossforboostingparameterselection.Usage cv.mbst(x,y,balance=FALSE,K=10,cost=NULL,family=c(\"hinge\ learner=c(\"tree\\"ls\\"sm\"),ctrl=bst_control(), type=c(\"risk\plot.it=TRUE,se=TRUE,n.cores=2,...)Arguments xybalanceKcostfamilylearnerctrltypeplot.it adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbeintegersfrom1toCforCclassproblem.logicalvalue.IfTRUE,TheKpartswereroughlybalanced,ensuringthattheclassesweredistributedproportionallyamongeachoftheKparts.K-foldcross-validation pricetopayforfalsepositive,0 forfamily=\"hinge\",type=\"risk\"ishingerisk.Forfamily=\"mhingedcf\",type=\"risk\" alogicalvalue,toplottheestimatedrisksifTRUE. cv.mhingebst sen.cores...Value objectwithresidmatfractioncvcv.error...SeeAlso mbst empiricalrisksineachcross-validationatboostingiterationsabscissavaluesatwhichCVcurveshouldbecomputed.TheCVcurveateachvalueoffractionThestandarderroroftheCVcurvealogicalvalue,toplotwithstandarderrors. 11 ThenumberofCPUcorestouse.Thecross-validationloopwillattempttosenddifferentCVfoldsofftodifferentcores.additionalarguments. cv.mhingebstCross-ValidationforMulti-classHingeBoosting Description Cross-validatedestimationoftheempiricalmulti-classhingelossforboostingparameterselection.Usage cv.mhingebst(x,y,balance=FALSE,K=10,cost=NULL,family=\"hinge\learner=c(\"tree\\"ls\\"sm\"),ctrl=bst_control(), type=c(\"risk\plot.it=TRUE,se=TRUE,n.cores=2,...)Arguments xybalanceKcostfamilylearner adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbeintegersfrom1toCforCclassproblem.logicalvalue.IfTRUE,TheKpartswereroughlybalanced,ensuringthattheclassesweredistributedproportionallyamongeachoftheKparts.K-foldcross-validation pricetopayforfalsepositive,0 12 ctrltypeplot.itsen.cores...Value objectwithresidmatfractioncvcv.error...SeeAlso mhingebst empiricalrisksineachcross-validationatboostingiterationsabscissavaluesatwhichCVcurveshouldbecomputed.TheCVcurveateachvalueoffractionThestandarderroroftheCVcurveanobjectofclassbst_control. forfamily=\"hinge\",type=\"risk\"ishingerisk.alogicalvalue,toplottheestimatedrisksifTRUE.alogicalvalue,toplotwithstandarderrors. cv.mhingeova ThenumberofCPUcorestouse.Thecross-validationloopwillattempttosenddifferentCVfoldsofftodifferentcores.additionalarguments. cv.mhingeovaCross-Validationforone-vs-allHingeBoostwithmulti-classproblem Description Cross-validatedestimationoftheempiricalmisclassificationerrorforboostingparameterselection.Usage cv.mhingeova(x,y,balance=FALSE,K=10,cost=NULL,nu=0.1, learner=c(\"tree\\"ls\\"sm\"),maxdepth=1,m1=200,twinboost=FALSE,m2=200,trace=FALSE,plot.it=TRUE,se=TRUE,...)Arguments xybalanceKcost adataframecontainingthevariablesinthemodel. vectorofmulticlassresponses.ymustbeanintergervectorfrom1toCforCclassproblem. logicalvalue.IfTRUE,TheKpartswereroughlybalanced,ensuringthattheclassesweredistributedproportionallyamongeachoftheKparts.K-foldcross-validation pricetopayforfalsepositive,0 nulearnermaxdepthm1twinboostm2traceplot.itse...Value objectwithresidmatfractioncvcv.error...Note ThefunctionsforbalancedcrossvalidationwerefromRpackagepmar.SeeAlso mhingeova empiricalrisksineachcross-validationatboostingiterationsabscissavaluesatwhichCVcurveshouldbecomputed.TheCVcurveateachvalueoffractionThestandarderroroftheCVcurve 13 asmallnumber(between0and1)definingthestepsizeorshrinkageparameter.acharacterspecifyingthecomponent-wisebaselearnertobeused:lslinearmodels,smsmoothingsplines,treeregressiontrees.treedepthusedinlearner=treenumberofboostingiterationlogical:twinboosting? numberoftwinboostingiterationifTRUE,iterationresultsprintedout alogicalvalue,toplottheestimatedrisksifTRUE.alogicalvalue,toplotwithstandarderrors.additionalarguments. ex1dataGeneratingThree-classDatawith50Predictors Description Randomlygeneratedataforathree-classmodel.Usage ex1data(n.data)Arguments n.data numberofdatasamples. 14Details ThedataisgeneratedbasedonExample1describedinWang(2011).Value mada Alistwithn.databy50predictormatrixx,three-classresponseyandconditionalprobabilitiesp.Author(s) ZhuWangReferences ZhuWang(2012),Multi-classHingeBoost:MethodandApplicationtotheClassificationofCancerTypesUsingGeneExpressionData.MethodsofInformationinMedicine,51(2),162–7.Examples ##Notrun: dat<-ex1data(200) mhingebst(x=dat$x,y=dat$y)##End(Notrun) lossInternalFunction Description InternalFunction madaMulti-classAdaBoost Description One-vs-allmulti-classAdaBoostUsage mada(xtr,ytr,xte=NULL,yte=NULL,mstop=50,nu=0.1,interaction.depth=1) mbstArguments xtrytrxteytemstopnu trainingdatamatrixcontainingthepredictorvariablesinthemodel. 15 trainingvectorofresponses.ytrmustbeintegersfrom1toC,forCclassproblem. testdatamatrixcontainingthepredictorvariablesinthemodel. testvectorofresponses.ytemustbeintegersfrom1toC,forCclassproblem.numberofboostingiteration. asmallnumber(between0and1)definingthestepsizeorshrinkageparameter. interaction.depth usedingbmtospecifythedepthoftrees.Details ForaC-classproblem(C>2),eachclassisseparatelycomparedagainstallotherclasseswithAdaBoost,andCfunctionsareestimatedtorepresentconfidenceforeachclass.Theclassificationruleistoassigntheclasswiththelargestestimate.Value Alistcontainsvariableselectedxselectandtrainingandtestingerrorerr.tr,err.te.Author(s) ZhuWangSeeAlso cv.madaforcross-validatedstoppingiteration.Examples data(iris) mada(xtr=iris[,-5],ytr=iris[,5]) mbstBoostingforMulti-Classification Description Gradientboostingforoptimizingmulti-classhingeorrobusthingelosslossfunctionswithcompo-nentwiselinear,smoothingsplines,treemodelsasbaselearners. 16Usage mbst(x,y,cost=NULL,family=c(\"hinge\\"hinge2\\"thingeDC\"),ctrl=bst_control(),control.tree=list(fixed.depth=TRUE, n.term.node=6,maxdepth=1),learner=c(\"ls\\"sm\\"tree\"))##S3methodforclassmbstprint(x,...) ##S3methodforclassmbst predict(object,newdata=NULL,newy=NULL,mstop=NULL,type=c(\"response\\"class\\"loss\\"error\"),...)##S3methodforclassmbst fpartial(object,mstop=NULL,newdata=NULL)Arguments xycostfamily adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbe1,2,...,kforakclassificationproblem mbst pricetopayforfalsepositive,0 acharacterspecifyingthecomponent-wisebaselearnertobeused:lslinearmodels,smsmoothingsplines,treeregressiontrees. inpredictacharacterindicatingwhethertheresponse,allresponsesacrosstheboostingiterations,classes,lossorclassificationerrorsshouldbepredictedincaseofhingeproblems.inplot,plotofboostingiterationor$L_1$norm.classofmbst. newdataforpredictionwiththesamenumberofcolumnsasx.newresponse. boostingiterationforprediction.additionalarguments. ctrlcontrol.treelearnertype objectnewdatanewymstop...Details Alinearornonlinearclassifierisfittedusingaboostingalgorithmformulti-classresponses.Thisfunctionisdifferentfrommhingebstonhowtodealwithzero-to-sumeconstraintandlossfunc-tions.Iffamily=\"hinge\",thelossfunctionisthesameasinmhingebstbuttheboostingalgorithmisdifferent.Iffamily=\"hinge2\",thelossfunctionisdifferentfromfamily=\"hinge\":theresponseisnotrecodedasinWang(2012).Inthiscase,thelossfunctionis I(yi=j)(fj+1)+.family=\"thingeDC\"forrobustlossfunctionusedintheDCBalgorithm. mbstValue 17 Anobjectofclassmbstwithprint,coef,plotandpredictmethodsareavailableforlinearmodels.Fornonlinearmodels,methodsprintandpredictareavailable.x,y,cost,family,learner,control.tree,maxdepth Theseareinputvariablesandparametersctrlyhatensml.fitensemblexselectcoefAuthor(s) ZhuWangReferences ZhuWang(2011),HingeBoost:ROC-BasedBoostforClassificationandVariableSelection.TheInternationalJournalofBiostatistics,7(1),Article13. ZhuWang(2012),Multi-classHingeBoost:MethodandApplicationtotheClassificationofCancerTypesUsingGeneExpressionData.MethodsofInformationinMedicine,51(2),162–7.SeeAlso cv.mbstforcross-validatedstoppingiteration.Furthermoreseebst_controlExamples x<-matrix(rnorm(100*5),ncol=5) c<-quantile(x[,1],prob=c(0.33,0.67))y<-rep(1,100) y[x[,1]>c[1]&x[,1] dat.m<-mbst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")predict(dat.m) dat.m1<-mbst(x,y,ctrl=bst_control(twinboost=TRUE, f.init=predict(dat.m),xselect.init=dat.m$xselect,mstop=50)) dat.m2<-rmbst(x,y,ctrl=bst_control(mstop=50,s=1,trace=TRUE),rfamily=\"thinge\learner=\"ls\")predict(dat.m2) theinputctrlwithpossibleupdatedfkiffamily=\"thingeDC\"predictedfunctionestimates alistoflengthmstop.Eachelementisafittedmodeltothepsedoresiduals,definedasnegativegradientoflossfunctionatthecurrentestimatedfunctionthelastelementofens avectoroflengthmstop.Eachelementisthevariableselectedineachboostingstepwhenapplicableselectedvariablesinmstop estimatedcoefficientsineachiteration.Usedinternallyonly 18mhingebst mhingebstBoostingforMulti-classClassification Description Gradientboostingforoptimizingmulti-classhingelossfunctionswithcomponentwiselinearleastsquares,smoothingsplinesandtreesasbaselearners.Usage mhingebst(x,y,cost=NULL,family=c(\"hinge\"),ctrl=bst_control(),control.tree=list(fixed.depth=TRUE,n.term.node=6,maxdepth=1),learner=c(\"ls\\"sm\\"tree\"))##S3methodforclassmhingebstprint(x,...) ##S3methodforclassmhingebst predict(object,newdata=NULL,newy=NULL,mstop=NULL,type=c(\"response\\"class\\"loss\\"error\"),...)##S3methodforclassmhingebst fpartial(object,mstop=NULL,newdata=NULL)Arguments xycostfamilyctrl control.treelearnertypeobjectnewdatanewymstop...Details Alinearornonlinearclassifierisfittedusingaboostingalgorithmbasedoncomponent-wisebaselearnersformulti-classresponses. adataframecontainingthevariablesinthemodel. vectorofresponses.ymustbein{1,-1}forfamily=\"hinge\".equalcostsfornowandunequalcostswillbeimplementedinthefuture.family=\"hinge\"formulti-classhingeloss.anobjectofclassbst_control.controlparametersofrpart. acharacterspecifyingthecomponent-wisebaselearnertobeused:lslinearmodels,smsmoothingsplines,treeregressiontrees. inpredictacharacterindicatingwhethertheresponse,classes,lossorclassifi-cationerrorsshouldbepredictedincaseofhingeclassofmhingebst. newdataforpredictionwiththesamenumberofcolumnsasx.newresponse. boostingiterationforprediction.additionalarguments. mhingeovaValue 19 Anobjectofclassmhingebstwithprintandpredictmethodsbeingavailableforfittedmodels.Author(s) ZhuWangReferences ZhuWang(2011),HingeBoost:ROC-BasedBoostforClassificationandVariableSelection.TheInternationalJournalofBiostatistics,7(1),Article13. ZhuWang(2012),Multi-classHingeBoost:MethodandApplicationtotheClassificationofCancerTypesUsingGeneExpressionData.MethodsofInformationinMedicine,51(2),162–7.SeeAlso cv.mhingebstforcross-validatedstoppingiteration.Furthermoreseebst_controlExamples ##Notrun: dat<-ex1data(100) res<-mhingebst(x=dat$x,y=dat$y)##End(Notrun) mhingeovaMulti-classHingeBoost Description Multi-classalgorithmwithone-vs-allbinaryHingeBoostwhichoptimizesthehingelossfunctionswithcomponentwiselinear,smoothingsplines,treemodelsasbaselearners.Usage mhingeova(xtr,ytr,xte=NULL,yte=NULL,cost=NULL,nu=0.1, learner=c(\"tree\\"ls\\"sm\"),maxdepth=1,m1=200,twinboost=FALSE,m2=200)##S3methodforclassmhingeovaprint(x,...) 20Arguments xtrytrxteytecostnulearnermaxdepthm1twinboostm2x...Details trainingdatacontainingthepredictorvariables. vectoroftrainingdataresponses.ytrmustbein{1,2,...,k}.testdatacontainingthepredictorvariables. vectoroftestdataresponses.ytemustbein{1,2,...,k}. mhingeova defaultisNULLforequalcost;otherwiseanumericvectorindicatingpricetopayforfalsepositive,0 numberoftwinboostingiterationclassofmhingeova.additionalarguments. ForaC-classproblem(C>2),eachclassisseparatelycomparedagainstallotherclasseswithHingeBoost,andCfunctionsareestimatedtorepresentconfidenceforeachclass.Theclassificationruleistoassigntheclasswiththelargestestimate.Alinearornonlinearmulti-classHingeBoostclassifierisfittedusingaboostingalgorithmbasedonone-againstcomponent-wisebaselearnersfor+1/-1responses,withpossiblecost-sensitivehingelossfunction.Value Anobjectofclassmhingeovawithprintmethodbeingavailable.Author(s) ZhuWangReferences ZhuWang(2011),HingeBoost:ROC-BasedBoostforClassificationandVariableSelection.TheInternationalJournalofBiostatistics,7(1),Article13. ZhuWang(2012),Multi-classHingeBoost:MethodandApplicationtotheClassificationofCancerTypesUsingGeneExpressionData.MethodsofInformationinMedicine,51(2),162–7.SeeAlso bstforHingeBoostbinaryclassification.Furthermoreseecv.bstforstoppingiterationselectionbycross-validation,andbst_controlforcontrolparameters. nselExamples ##Notrun: dat1<-read.table(\"http://archive.ics.uci.edu/ml/machine-learning-databases/thyroid-disease/ann-train.data\") dat2<-read.table(\"http://archive.ics.uci.edu/ml/machine-learning-databases/thyroid-disease/ann-test.data\") res<-mhingeova(xtr=dat1[,-22],ytr=dat1[,22],xte=dat2[,-22],yte=dat2[,22],cost=c(2/3,0.5,0.5),nu=0.5,learner=\"ls\m1=100,K=5,cv1=FALSE,twinboost=TRUE,m2=200,cv2=FALSE) res<-mhingeova(xtr=dat1[,-22],ytr=dat1[,22],xte=dat2[,-22],yte=dat2[,22],cost=c(2/3,0.5,0.5),nu=0.5,learner=\"ls\m1=100,K=5,cv1=FALSE,twinboost=TRUE,m2=200,cv2=TRUE)##End(Notrun) 21 nselFindNumberofVariablesInMulti-classBoostingIterations Description FindNumberofVariablesInMulti-classBoostingIterationsUsage nsel(object,mstop)Arguments objectmstopValue avectoroflengthmstopindicatingnumberofvariablesselectedineachboostingiterationAuthor(s) ZhuWang anobjectofmhingebst,mbst,orrmbstboostingiterationnumber 22rbst rbstRobustBoostingforTruncatedLossFunctions Description Gradientboostingforoptimizingrobustlossfunctionswithcomponentwiselinear,smoothingsplines,treemodelsasbaselearners.Usage rbst(x,y,cost=0.5,rfamily=c(\"tgaussian\\"thuber\\"tbinom\\"binomd\\"texpo\\"tpoisson\"),ctrl=bst_control(),control.tree=list(maxdepth=1),learner=c(\"ls\Arguments xycostrfamily adataframecontainingthevariablesinthemodel.vectorofresponses.ymustbein{1,-1}. pricetopayforfalsepositive,0 ctrl control.treelearnerdelDetails Alinearornonlinearclassifierisfittedusingrobustboostingalgorithm.Value Anobjectofclassbstwithprint,coef,plotandpredictmethodsareavailableforlinearmodels.Fornonlinearmodels,methodsprintandpredictareavailable.x,y,cost,rfamily,learner,control.tree,maxdepth Theseareinputvariablesandparametersctrlyhatensml.fit predictedfunctionestimates alistoflengthmstop.Eachelementisafittedmodeltothepsedoresiduals,definedasnegativegradientoflossfunctionatthecurrentestimatedfunctionthelastelementofens theinputctrlwithpossibleupdatedfkiffamily=\"tgaussian\\"thingeDC\\"binomdD rbstpath ensemblexselectcoefAuthor(s) ZhuWangSeeAlso cv.bstforcross-validatedstoppingiteration.Furthermoreseebst_controlExamples x<-matrix(rnorm(100*5),ncol=5)c<-2*x[,1] p<-exp(c)/(exp(c)+exp(-c))y<-rbinom(100,1,p)y[y!=1]<--1 y[1:10]<--y[1:10]x<-as.data.frame(x) dat.m<-bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")predict(dat.m) dat.m1<-bst(x,y,ctrl=bst_control(twinboost=TRUE, coefir=coef(dat.m),xselect.init=dat.m$xselect,mstop=50)) dat.m2<-rbst(x,y,ctrl=bst_control(mstop=50,s=0,trace=TRUE),rfamily=\"thinge\learner=\"ls\")predict(dat.m2) 23 avectoroflengthmstop.Eachelementisthevariableselectedineachboostingstepwhenapplicableselectedvariablesinmstopestimatedcoefficientsinmstop rbstpathRobustBoostingPathforTruncatedLossFunctions Description Gradientboostingpathforoptimizingrobustlossfunctionswithcomponentwiselinear,smoothingsplines,treemodelsasbaselearners.Usage rbstpath(x,y,rmstop=seq(40,400,by=20),ctrl=bst_control(),del=1e-16,...)Arguments xyrmstop adataframecontainingthevariablesinthemodel.vectorofresponses.ymustbein{1,-1}.vectorofboostingiterations 24 ctrldel...Details anobjectofclassbst_control.convergencycriteraargumentspassedtorbst rmbst Thisfunctioninvokesrbstwithmstopbeingeachelementofvectorrmstop.Itcanprovidedif-ferentpaths.Thusrmstopservesasanotherhyper-parameter.However,themostimportanthyper-parameteristhelosstruncationpoint.Value Alengthrmstopvectoroflistswitheachelementbeinganobjectofclassrbst.Author(s) ZhuWangSeeAlso rbstExamples x<-matrix(rnorm(100*5),ncol=5)c<-2*x[,1] p<-exp(c)/(exp(c)+exp(-c))y<-rbinom(100,1,p)y[y!=1]<--1 y[1:10]<--y[1:10]x<-as.data.frame(x) dat.m<-bst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")predict(dat.m) dat.m1<-bst(x,y,ctrl=bst_control(twinboost=TRUE, coefir=coef(dat.m),xselect.init=dat.m$xselect,mstop=50)) dat.m2<-rbst(x,y,ctrl=bst_control(mstop=50,s=0,trace=TRUE),rfamily=\"thinge\learner=\"ls\")predict(dat.m2) rmstop<-seq(10,40,by=10) dat.m3<-rbstpath(x,y,rmstop,rfamily=\"thinge\learner=\"ls\") rmbstRobustBoostingforMulti-classTruncatedLossFunctions Description Gradientboostingforoptimizingrobustlossfunctionswithcomponentwiselinear,smoothingsplines,treemodelsasbaselearners. rmbstUsage 25 rmbst(x,y,cost=0.5,rfamily=\"thingehreshold=c(\"adaptive\\"standard\"), ctrl=bst_control(),control.tree=list(maxdepth=1),learner=c(\"ls\Arguments xycostrfamilythresholdctrl control.treelearnerdelDetails Alinearornonlinearclassifierisfittedusingrobustboostingalgorithm.Value Anobjectofclassbstwithprint,coef,plotandpredictmethodsareavailableforlinearmodels.Fornonlinearmodels,methodsprintandpredictareavailable.x,y,cost,rfamily,learner,control.tree,maxdepth Theseareinputvariablesandparametersctrlyhatensml.fitensemblexselectcoefAuthor(s) ZhuWangSeeAlso cv.mbstforcross-validatedstoppingiteration.Furthermoreseebst_control theinputctrlwithpossibleupdatedfkiftype=\"adaptive\"predictedfunctionestimates alistoflengthmstop.Eachelementisafittedmodeltothepsedoresiduals,definedasnegativegradientoflossfunctionatthecurrentestimatedfunctionthelastelementofens avectoroflengthmstop.Eachelementisthevariableselectedineachboostingstepwhenapplicableselectedvariablesinmstopestimatedcoefficientsinmstop adataframecontainingthevariablesinthemodel.vectorofresponses.ymustbein{1,2,...,k}. pricetopayforfalsepositive,0 acharacterspecifyingthecomponent-wisebaselearnertobeused:lslinearmodels,smsmoothingsplines,treeregressiontrees.convergencycritera 26Examples rmbst x<-matrix(rnorm(100*5),ncol=5) c<-quantile(x[,1],prob=c(0.33,0.67))y<-rep(1,100) y[x[,1]>c[1]&x[,1] dat.m<-mbst(x,y,ctrl=bst_control(mstop=50),family=\"hinge\learner=\"ls\")predict(dat.m) dat.m1<-mbst(x,y,ctrl=bst_control(twinboost=TRUE, f.init=predict(dat.m),xselect.init=dat.m$xselect,mstop=50)) dat.m2<-rmbst(x,y,ctrl=bst_control(mstop=50,s=1,trace=TRUE),rfamily=\"thinge\learner=\"ls\")predict(dat.m2) Index ∗Topicclassification bstex1data,2 mada,13mbst,14mhingebst,15 mhingeova,18rbst,19rbstpath,22rmbst,24,23∗Topicmodels bst.sel,5∗Topicregression bst.sel,5 balanced.foldsbst(lossbst-package,2,3,5,7,9,20),14bst.sel,2bst_control,5 ,3,4,6,8,10,12,16–20,22–25coefcoef.bst,4,17cv.bst(,bst22,),252cv.mada,4,5,8,20,23cv.mbst,cv.mhingebst,910,15,17,25cv.mhingeova,11,19cvfolds(loss,),1214error.barsex1data,13 (loss),14fpartial.bstfpartial.mbst(bstfpartial.mhingebst(mbst),2)(,mhingebst15 ),18gausslossgaussngra((lossloss)),,1414hingeloss(loss),14 hingengra(loss),14loss,14 madambst,mbst_fit,1011,,14 15,mhingebst(loss16,),2114 mhingebst_fit,12,18mhingeova,13,19(loss,18,21,20),14ngradientnsel,21 (loss),14permute.rowsplot(plot.bst,3,4,17,22loss,25),14plotCVbst(bst),2predictpredict.bst,3,(4loss,),14 predict.mbst(17bst,19,22,25predict.mhingebst(mbst),2)printprint.bst,4,17,19(,mhingebst15 ),18print.mbst(bst,)20,22,25print.mhingebst(mbst,2)print.mhingeova(,(mhingebst15 mhingeova)),,1819rbstrbstpath,22,24rmbst,21,,2324 27
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务