You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great, thanks for figuring this out! I would have to check if changing it to a weighted fraction is still compatible with older versions of scikit-learn.
Connected with the change in scikit, I think that the values of "votes" should be divided by "node_count"
API Change The tree_.value attribute in tree.DecisionTreeClassifier, tree.DecisionTreeRegressor, tree.ExtraTreeClassifier and tree.ExtraTreeRegressor changed from an weighted absolute count of number of samples to a weighted fraction of the total number of samples. #27639 by Samuel Ronsin.
Suggest to change line 276 of tree.py:
Originally:
votes = [[[float(votes_for(c).get('recordCount')) if votes_for(c) is not None else 0.0 for c in classes]]]
Suggested:
votes = [[[float(votes_for(c).get('recordCount')) / node_count if votes_for(c) is not None else 0.0 for c in classes]]]
The text was updated successfully, but these errors were encountered: