Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion matrix error #947

Closed
rczen opened this issue Oct 4, 2018 · 4 comments
Closed

Confusion matrix error #947

rczen opened this issue Oct 4, 2018 · 4 comments

Comments

@rczen
Copy link

rczen commented Oct 4, 2018

Hello,

I am asking for the confusion matrix using the following line:

confusionMatrix(cart.model, test$meet_kpi, positive='No')

and get the following error:

Error in match.arg(norm, c("none", "overall", "average")) :
'arg' must be NULL or a character vector

I would like to find out what is the nature of this error, what is the complaint.

Thanks in advance,

Ronen

@rczen
Copy link
Author

rczen commented Oct 4, 2018

problem solved.

@rczen rczen closed this as completed Oct 4, 2018
@jtorresec
Copy link

Hi, can you show how did you solve this problem? I have de same

@cramezan
Copy link

He was predicting on his model in the confusion matrix, rather than the prediction itself. I just ran into error this myself.

For my code which produced the error:

svm.model001 <- train(class_name~., data=Train001, method = "svmRadial",
tuneLength = 10,
preProcess = c("center", "scale"),
trControl = trainctrl,
metric="Kappa")

svm.predict001 <-predict(svm.model001, DelTest, verboseIter = TRUE)
confusionMatrix(svm.model001, as.factor(DelTest$class_name))

The issue is in the confusionMatrix line. It should read my stored prediction variable instead of the model variable.
confusionMatrix(svm.predict001, as.factor(DelTest$class_name))

@niharikakotaru
Copy link

He was predicting on his model in the confusion matrix, rather than the prediction itself. I just ran into error this myself.

For my code which produced the error:

svm.model001 <- train(class_name~., data=Train001, method = "svmRadial", tuneLength = 10, preProcess = c("center", "scale"), trControl = trainctrl, metric="Kappa")

svm.predict001 <-predict(svm.model001, DelTest, verboseIter = TRUE) confusionMatrix(svm.model001, as.factor(DelTest$class_name))

The issue is in the confusionMatrix line. It should read my stored prediction variable instead of the model variable. confusionMatrix(svm.predict001, as.factor(DelTest$class_name))

Thank you so much! it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants