8000 Exporting a single node DecisionTreeClassifier to dot graph raises error when filled is True · Issue #6580 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Exporting a single node DecisionTreeClassifier to dot graph raises error when filled is True #6580
Closed
@raghavrv

Description

@raghavrv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyWell-defined and straightforward way to resolve

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0