Skip to content

Plot decision tree #856

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Decision trees are one of the few models that are easy to visualize. However, we don't offer any visualization at the moment.

Desired solution

  • Add a method plot() -> Image to DecisionTreeRegressor and DecisionTreeClassifier.
  • Raise a ModelNotFittedError if the model is not fitted yet.

Implementation:

  • Use plot_tree.
  • Avoid code duplication, e.g. by adding the method to the common superclass _DecisionTreeBase.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions