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

前端 未结 3 1051
感动是毒
感动是毒 2020-12-23 19:14

I have a number of classes and corresponding feature vectors, and when I run predict_proba() I will get this:

classes = [\'one\',\'two\',\'three\',\'one\',\'         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 19:51

    As a rule, any attribute in a learner that ends with _ is a learned one. In your case you're looking for clf.classes_.

    Generally in Python, you can use the dir function to find out which attributes an object has.

提交回复
热议问题