0
我試圖創建一個隨機森林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
我已經證實了所有預測都是正確的格式,結果以因子格式。任何幫助是極大的讚賞!