我试图使用PAM作为分类器,但我找不到找到使用多少基因的方法。这是代码:
install.packages("plsgenomics")
library("plsgenomics")
library("pamr")
data(Colon)
data<-t(Colon$X)
rownames(data)<-Colon$gene.names
grp<-Colon$Y
grp = as.factor(grp)
tr.data = list(x = data, y = grp)
tr.train = pamr.train(tr.data)
new.scales <- pamr.adaptthresh(tr.train)
tr.train2 <- pamr.train(tr.data, threshold.scale=new.scales,prior = c(0.5,0.5))
tr.train2
Call:
pamr.train(data = tr.data, threshold.scale = new.scales, prior = c(0.5,
0.5))
threshold nonzero errors
1 0.000 2000 18
2 0.189 1490 13
3 0.379 1128 11
..........................
28 5.112 1 9
29 5.301 1 9
30 5.490 0 40
> new.scales
1 2
1.000000 2.867972