我在MLSeq
R 版本 3.1.2 的 Ubuntu 上使用 bioconductor 包。我已经尝试运行包提供的示例,并且效果很好。但是,我想使用bagsvm
该函数的方法classify
,所以在chunk 14
,我将代码从
svm <- classify(data = data.trainS4, method = "svm", normalize = "deseq",
deseqTransform = "vst", cv = 5, rpt = 3, ref = "T")
至
bagsvm <- classify(data = data.trainS4, method = "bagsvm", normalize = "deseq",
deseqTransform = "vst", cv = 5, rpt = 3, ref = "T")
这产生了错误:
Something is wrong; all the Accuracy metric values are missing:
Accuracy Kappa
Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA
Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA
NA's :1 NA's :1
Error in train.default(counts, conditions, method = "bag", B = B, bagControl = bagControl(fit = svmBag$fit, :
Stopping
In addition: There were 17 warnings (use warnings() to see them)
警告是:
Warning messages:
1: executing %dopar% sequentially: no parallel backend registered
2: In eval(expr, envir, enclos) :
model fit failed for Fold1.Rep1: vars=150 Error in fitter(btSamples[[iter]], x = x, y = y, ctrl = bagControl, v = vars, :
task 1 failed - "could not find function "lev""
然后将警告 2 重复 14 次,然后:
17: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, ... :
There were missing values in resampled performance measures.
traceback()
生产
4:停止(“停止”) 3:train.default(计数,条件,方法=“包”,B = B,bagControl = bagControl(fit = svmBag$fit, 预测 = svmBag$pred,聚合 = svmBag$aggregate),trControl = ctrl, ...) 2:火车(计数,条件,方法=“包”,B = B,bagControl = bagControl(fit = svmBag$fit, 预测 = svmBag$pred,聚合 = svmBag$aggregate),trControl = ctrl, ...) 1:分类(数据= data.trainS4,方法=“bagsvm”,标准化=“deseq”, deseqTransform = "vst", cv = 5, rpt = 3, ref = "T")
我认为问题可能是kernlab
我认为 MLSeq 代码使用的库没有被加载所以我尝试了
library(kernlab)
bagsvm <- classify(data = data.trainS4, method = "bagsvm", normalize = "deseq",
deseqTransform = "vst", cv = 5, rpt = 3, ref = "T")
这导致了相同的错误,但警告更改为:
警告信息: 1:在 eval(expr, envir, enclos) 中: Fold1.Rep1 的模型拟合失败:vars=150 拟合器错误(btSamples[[iter]],x = x,y = y,ctrl = bagControl,v = vars,: 任务 1 失败 - “没有适用于 'predict' 的方法应用于类“c('ksvm', 'vm')”的对象
重复 15 次,然后
16: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, ... :
There were missing values in resampled performance measures.
我不相信这个问题是特定于MLSeq
我尝试运行该train
功能的
ctrl <- trainControl(method = "repeatedcv", number = 5,
repeats = 3)
train <- train(counts, conditions, method = "bag", B = 100,
bagControl = bagControl(fit = svmBag$fit, predict = svmBag$pred,
aggregate = svmBag$aggregate), trControl = ctrl)
其中counts
是带有 RNASeq 数据的数据框,并且conditions
是类的一个因素,我得到了完全相同的结果。任何帮助深表感谢。