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.