Closed
Description
Code to reproduce -
from sklearn.tree import DecisionTreeClassifier
from sklearn.tree import export_graphviz
import numpy as np
dtc = DecisionTreeClassifier().fit(np.random.random_sample((20, 2)), np.zeros((20, 1)))
export_graphviz(dtc, filled=True)
This is because the max_impurity
and min_impurity
are the same for a single node tree (colors['bounds'][0]
== colors['bounds'][1]
).
We should set the color in this case to a single value directly.