CART - ERROR while creating predict values

30 views Asked by At

I split the original dataset with 0.7, checked prop.table. achieved best proportion of train & test data.

after creating classification tree, applied bestcp value and pruned tree.

while i attempt to run -

bank3train$predict= predict(prunedtree,data= bank3train, type = 'class')

I get an error as -

Error in $<-.data.frame(*tmp*, predict, value = c(1L, 1L, 1L, 1L, : replacement has 5000 rows, data has 3202

checked in google - was told because of NA values - but NA values were treated by omiting the rows.

please advise corrective action.

0

There are 0 answers