# # # R代码从装饰图案的UsingMCRestimate来源。Rnw“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块1号:参数# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #库(MCRestimate)库(randomForest)库(golubEsets)数据(Golub_Train)类。科勒姆< -“所有。AML“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块2号:功能# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # savepdf = function (x,文件、w = 10 h = 5) {pdf(=文件,宽度= w,身高= w); x; dev.off()}选项(宽度= 50)# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块3号:方法选择# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Preprocessingfunctions < - c list.of.poss (“varSel.highest.var”)。参数< -列表(var.numbers = c(250、1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块数量4:方法选择# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #类。<——“射频功能。用“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块5号:情节参数# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #阴谋。标签<——“样本”# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块6号:理由CROSS-VALIDSATION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #的十字架。外< - 2交叉。< - 3交叉重复。内心的< - 2 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块7号:射频。让# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # RF.estimate < - MCRestimate (Golub_Train、类。科勒姆,classification.fun = "射频。包”,thePreprocessingMethods = Preprocessingfunctions poss.parameters = list.of.poss。参数,cross.outer =十字架。外,cross.inner =十字架。内,cross.repeat =十字架。repeat, plot.label=plot.label) ################################################### ### code chunk number 8: rf.show ################################################### class(RF.estimate) ################################################### ### code chunk number 9: RF (eval = FALSE) ################################################### ## plot(RF.estimate,rownames.from.object=TRUE, main="Random Forest") ################################################### ### code chunk number 10: rf.save ################################################### savepdf(plot(RF.estimate,rownames.from.object=TRUE, main="Random Forest"),"RF.pdf") ################################################### ### code chunk number 11: UsingMCRestimate.Rnw:157-163 ################################################### RF.classifier <- ClassifierBuild (Golub_Train, class.colum, classification.fun="RF.wrap", thePreprocessingMethods=Preprocessingfunctions, poss.parameters=list.of.poss.parameter, cross.inner=cross.inner) ################################################### ### code chunk number 12: UsingMCRestimate.Rnw:167-168 ################################################### names(RF.classifier) ################################################### ### code chunk number 13: test ################################################### data(Golub_Test) RF.classifier$classifier.for.exprSet(Golub_Test)