How to get actual score for class in classifier


I’m doing multi class classification with MeTA and I found that in some cases I need to know not only a class for an item, but also a score - how probable this item rely to a selected class, to measure, let’s call it “classification confidence”. Is there a way to get this data without actually changing MeTA sources?


Our logistic_regression implementation has a predict() function that will give you a dictionary from class_label to probability of that class, so you could try using that if it gives you sufficient accuracy.

Not all of our multiclass classifiers provide that function, though. The main reasoning for this is that it’s not always obvious what the score should be for all multiclass classification algorithms. For example, while naive_bayes can give you probabilities as its “confidence” score easily, it’s perhaps a bit unclear what one_vs_one should give as its score. (It would be a good pull request, however, to add such a function to all of our classifiers that can provide a reasonable interpretation for their scores.)