How can I print the probability for each class when I am using the soft-voting classifier?
I have tried to print the probability for each class by soft-voting using Python, but I couldn't.
CodePudding user response:
If you are using scikit-learn you can use predict_proba
pred_proba = eclf.predict_proba(X)
Here eclf
is your Voting classifier and will return Weighted average probability for each class per sample.
pred_proba[0]
will contain list of probabilities per class for first sample, and pred_proba[1]
will contain list of probabilites per class for second sample and so on..