Skip to content

plot_tree always writes entropy even if gini is used #13944

@agramfort

Description

@agramfort
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True)
from sklearn.tree import DecisionTreeClassifier
tree = DecisionTreeClassifier(criterion='gini')
tree.fit(X, y)
from sklearn.tree import plot_tree
plot_tree(tree)

plots entropy in nodes. It's because entropy is hard coded here apparently:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/export.py#L553

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions