parrt / dtreeviz

A python library for decision tree visualization and model interpretation.
MIT License
2.94k stars 331 forks source link

Enhanced ctree_feature_space() that accepts a features arg rather than requiring a model with just 1 or 2 features. #253

Closed parrt closed 1 year ago

parrt commented 1 year ago

Signed-off-by: Terence Parr parrt@antlr.org

parrt commented 1 year ago

ok, ready for review! I updated sklearn notebook.

mepland commented 1 year ago

I think we should turn the y-axis on for univar when gtype='barstacked' otherwise you can't tell anything from the magnitude.

image

parrt commented 1 year ago

I guess it’s just a count, right?

tlapusan commented 1 year ago

Is there a need to reinitialize the decision tree/dtreeviz in case we want to use one and after that two features ? I think what @mepland initially suggested is to initialize a decision tree/dtreeviz model and after that to choose if you want to make a viz with one or two features. Like in the bellow screenshot :

Screenshot 2023-01-22 at 15 47 37
mepland commented 1 year ago

Is there a need to reinitialize the decision tree/dtreeviz in case we want to use one and after that two features ?

I think that is the current behavior, the screenshot looks fine to me?

tlapusan commented 1 year ago

I took the code from this PR and there is reinitialization for both classification and regression... @mepland can you check this also please ?

parrt commented 1 year ago

Good catch @tlapusan. Sorry about that. cleaned up and resubmitted the notebook so that it creates a single decision tree and model, then reuses that for visualization

mepland commented 1 year ago

I see what you mean now @tlapusan.

@parrt looks good to me now, but I would still like the option of having a y-axis for gtype='barstacked'.

parrt commented 1 year ago

@parrt looks good to me now, but I would still like the option of having a y-axis for gtype='barstacked'.

Fixed

Screenshot 2023-01-22 at 11 15 59 AM
parrt commented 1 year ago

OK, can you guys do one last quick check? If it looks good I can push it for a quick release so I can use it within colab.

parrt commented 1 year ago

Cool. I will push out a new version today.