I am trying to do a multiclass classification on a significant amount of output labels (1000).

I built a model using KNN. The accuracy given by accuracy = knn.score(X_test, y_test) is 0.5.

Does this mean that given an input, the model is able to predict 50% of the time which label the data belongs to? If yes, I would intuitively say that this is good, since randomly choosing a label would have a probability of 0.1%.

  • $\begingroup$ What is the class distribution of your data and predictions? $\endgroup$ – Sammy Feb 26 '20 at 8:57

Assuming it really is a one form many class problem and not a multi-label problem.

An accuracy of .5 would mean that half of the instances were classified correctly. That would also mean that the model is able to generate the correct class half of the time. For your test data, results can still vary for new data.

If that is a good score depends on more than the number of classes. Quite often one class is represented more than others. The ZeroR-score is a good baseline for that.

Suppose you have 10 classes and Class A makes up 30% of the population. A random proces would achieve an accuracy of .1, a proces that simple says "Class A" all the time, would post a .3 accuracy.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.