This is a newbie questions, so please bear with me. Given this random forest model:
from sklearn.ensemble import RandomForestClassifier
X = [ [2,1,1,1], [2,0,2,1], [3,1,1,1] ]
y = [ 0, 1, 2 ]
regr = RandomForestClassifier(n_estimators=200, max_depth=5)
regr.fit(X, y)
X_test = [ [3, 1, 1, 1] ]
y_result = regr.predict_proba(X_test)
print('y_result:' , y_result )
The result is:
y_result: [[0.26 0.05 0.69]]
I understand that these are the probabilities of the first, second and third value, or 0 = 26%, 1 = 5% and 2 = 69%.
Question: if the test set is [3, 1, 1, 1]
and it fits to the value 2
, why do I get 69%
probability of 2
instead of 100%
?