Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize custom decision tree #301

Open
erdiphd opened this issue Jul 15, 2023 · 1 comment
Open

Visualize custom decision tree #301

erdiphd opened this issue Jul 15, 2023 · 1 comment

Comments

@erdiphd
Copy link

erdiphd commented Jul 15, 2023

Hello
I would like to visualize my custom decisition tree without using the optimized decision tree from the sklearn library

clf = DecisionTreeClassifier(max_depth=4)
clf.fit(X, y)

For example;
I have the following Decision Tree and would like to visualize it using the dtreeviz library. How can I do it ?
Thanks

if _in_1 < 9.0:
    if _in_0 > 11.0:
        if _in_1 < 8.0:
            out=2
            
        else:
            out=0
            
        
    else:
        if _in_0 < 13.0:
            if _in_0 > 7.0:
                out=1
                
            else:
                out=0
                
            
        else:
            out=0
            
        
    
else:
    out=0
@tlapusan
Copy link
Collaborator

hi @erdiphd, if you look inside the details implementation of the dtreeviz, you will see that each supported library has a custom implementation of the shadow_decision_tree.ShadowDecTree().

If you want to display your own library, you should add a new implementation for ShadowDecTree.

Or maybe a simpler version would be to use Graphviz. You could check more for it and to see if it's a better fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants