Error in eval (predvars, data, env)

Hi, I'm receiving the error message of: Error in eval(predvars, data, env)

predict_test_unpruned <- predict(classTree1, newdata = test, type = "class")
ct_test_unpruned <- table(sold = test$Purchase, predictions = predict_test_unpruned)
err_test_unprned <- (ct_test_unpruned[1,2] + ct_test_unpruned[2,1])/nrow(test)

predict_test_pruned <- predict(pruned_classTree1, newdata = test, type = "class")
ct_test_pruned <- table(sold = test$Purchase, predictions = predict_test_pruned)
err_test_pruned <- (ct_train_pruned[1,2] + ct_test_pruned[2,1])/nrow(test)

predict_train_unpruned <- predict(classTree1, type = "class")
ct_train_unpruned <- table (sold = train$Purchase, predictions = pred_train_unpruned)
err_train_unprned <- (ct_train_unpruned[1,2] + ct_train_unpruned[2,1])/nrow(train)

predict_train_pruned <- predict(pruned_classTree1, type = "class")
ct_train_pruned <- table(sold = train$Purchase, predictions = predict_train_pruned)
err_train_pruned <- (ct_train_pruned[1,2] + ct_train_pruned[2,1])/nrow(train)

Hello @harrde, welcome in this group.

So you say somewhere is an error and you want us to guess where it is :wink: ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.