Error in predict.svm.. : test data does not match model - Any ideas?


I created a support vector machine for text classification. However, when I want to use it to predict new data, I get the following error message: Error in predict.svm(model, container@classification_matrix, prob = TRUE, : test data does not match model !
I could not figure out why I get this error.

The structure of the two containers look the following:

I would be really thankful if somebody could help me with this!

Best Regards and thank you a lot!

We don't know how you are using these data objects in code. Their dimensions are different but there is not enough to understand.

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

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.