[scikit-learn] Interpreting results of random forest classifier

Nicolas Hug niourf at gmail.com
Mon Dec 28 07:41:46 EST 2020


Hi David,

 > As I understand it now the 0 probability is probability that the 
prediction is wrong, and the 1 probability is the probability that the 
prediction is correct

No: in binary classification, the `predict_proba` method returns a 
single number in [0, 1] indicating the probability that the sample 
belongs to the positive class (1). In other words,   (proba <= 0.5  iff 
prediction == 0). The threshold is 0.5 since there are only 2 classes.

 > One thing I do not understand is why the probability ranges do not go 
from 0 to 100; they go from 0 to 49 for 0 probability and 49-100 for 1 
probability

This is a correct observation and it's a direct consequence of the above 
definition.

The way probabilities are computed is briefly described here: 
https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html#sklearn.ensemble.RandomForestClassifier.predict_proba

Nicolas

On 12/28/20 2:36 AM, DAVID cofield wrote:
>
> Could someone explain what the probability values provided by the 
> random forest classifier represents?
>
> When I run the classifier with two classes, I get prediction values 
> and associated to these prediction values are probabilities. As I 
> understand it now the 0 probability is probability that the prediction 
> is wrong, and the 1 probability is the probability that the prediction 
> is correct. One thing I do not understand is why the probability 
> ranges do not go from 0 to 100; they go from 0 to 49 for 0 probability 
> and 49-100 for 1 probability. How do I interpret  the probabilities?
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows 10
>
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20201228/89b11f56/attachment.html>


More information about the scikit-learn mailing list