### R代码从小插图来源' usingmcreestimate。Rnw ' ################################################### ### 代码块1号:参数 ################################################### 库(MCRestimate)图书馆(randomForest)图书馆(golubEsets)数据(Golub_Train)类。列<- "ALL. "AML " ################################################### ### 代码块数量2:功能 ################################################### savepdf = function (x,文件,w = 10, h = 5) {pdf(=文件,宽度= w,身高= w); x; dev.off()}选项(宽度= 50 ) ################################################### ### 代码块3号:方法选择 ################################################### Preprocessingfunctions < - c (varSel.highest.var) list.of.poss.parameter < -列表(var.numbers = c(250年,1000年 )) ################################################### ### 代码块数量4:选择方法 ################################################### 类。function <- "RF. "包装 " ################################################### ### 代码块5号:情节参数 ################################################### 情节。< -“样品标签 " ################################################### ### 代码块6号:CROSS-VALIDSATION参数 ################################################### 十字架。外<- 2叉。重复<- 3交叉。内心的< - 2 ################################################### ### 代码块7号:射频。使 ################################################### RF.estimate < - MCRestimate (Golub_Train类。科勒姆,classification.fun = "射频。` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `参数,cross.outer =十字架。外,cross.inner =十字架。inner, cross.repeat=cross.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)