You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the code as given, the confusionMatrix returns an error: Error: data and reference should be factors with the same levels.
A bit of digging turns up that the function is expecting the second argument to be a factor. It can be fixed by amending the line to: confusionMatrix(test_pred, as.factor(testing$V7))
The text was updated successfully, but these errors were encountered:
Running the code as given, the confusionMatrix returns an error:
Error: data and reference should be factors with the same levels.
A bit of digging turns up that the function is expecting the second argument to be a factor. It can be fixed by amending the line to:
confusionMatrix(test_pred, as.factor(testing$V7))
The text was updated successfully, but these errors were encountered: