Skip to content

sklearn.tree.export_dict #20051

Open
Open
@jwilber

Description

Currently, there are two options to get the decision tree representations: export_graphviz and export_text.

I would like to add export_dict, which will output the decision as a nested dictionary.

While you can convert the graphviz representation using cli tools, it's a bit unruly and is a weird workflow. When converting back, the nesting is also kind of weird, with /n chars floating around.

The main utility for json/dict representations are

  1. That they're far easier to work with for any front-end work.
  2. Working with a dict allows you to use the representation easily for any downstream tasks using the decision tree (that aren't raw inference).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions