0
我用CHAID構建了一個模型。現在我想用它來預測一個變量 - 像我將與樹()或軟件rpart()做到這一點:用RID中的CHAID做預測
MA_CHAID <- chaid(Data$target
~ Data$factor1
+ Data$factor2,
control = chaid_control(minprob = 0.001,
minsplit = 500,minbucket = 200),
data = Data
)
Data$MA_predict <- predict(MA_CHAID, Data)
但我收到此錯誤信息:
Error in `$<-.data.frame`(`*tmp*`, MA_predict, value = c(1L, 1L, :
replacement has 124855 rows, data has 379031
任何想法?
謝謝!