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)