decision tree - Arguments length error when trying to test model using party package in R -
i have divided data set 2 groups:
- transactions.train (80% of data)
- transactions.test (20% of data)
then built decision tree using ctree method party package follow:
transactions.tree <- ctree(dt_formula, data=transactions.train)
and can apply predict method on training set , use table function output result follow:
table(predict(transactions.tree), transactions.train$satisfaction)
but problem occurs when try output table based on testing set follow:
testpred <- predict(transactions.tree, newdata=transactions.test) table(testpred, transactions.test$satisfaction)
and error follow:
error in table(predict(pred = svm.pred, transactions.tree), transactions.test$satisfaction) : arguments must have same length
i have done research on similar cases suggested omitting na values did without changing error outcome.
can me poniting out what's problem here?
Comments
Post a Comment