【发布时间】:2017-04-17 14:47:16
【问题描述】:
我正在尝试使用以下代码在 R 中创建一个随机森林:
forest <-
randomForest(Responder_7yr ~ CD4_num_log + CD8_num_log + anergy_CD8_num_log +
anergy_CD4_num_log + part_exhaust_CD8_num_log + exhaustion_CD8_num_log +
exhaustion_CD4_num_log + senescence_CD8_num_log +
senescence_CD4_num_log + tcm_CD4negCD8pos_num_log +
nTreg_CD4posCD8neg_num_log + ln_cpep + A1C + Ins,
data=resp, na.action=na.omit, importance=TRUE)
我收到以下错误:
Error in `[.default`(table(observed = y, predicted = out.class), levels(y), :
subscript out of bounds
我已确认所有预测变量都采用正确的格式,并且结果采用因子格式。非常感谢任何帮助!
【问题讨论】:
标签: r random-forest