decision tree - Arguments length error when trying to test model using party package in R -


i have divided data set 2 groups:

  1. transactions.train (80% of data)
  2. 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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -