How to find the corresponding class in clf.predict_proba()

Just use the .classes_ attribute of the classifier to recover the mapping. In your example that gives:

>>> clf.classes_
array(['one', 'three', 'two'], 
      dtype="|S5")

And thanks for putting a minimalistic reproduction script in your question, it makes answering really easy by just copy and pasting in a IPython shell 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)