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

tree visulization in decision tree(it is helpful for user) #1330

Closed
1998kajal opened this issue Apr 9, 2020 · 2 comments
Closed

tree visulization in decision tree(it is helpful for user) #1330

1998kajal opened this issue Apr 9, 2020 · 2 comments
Labels
type:enhancement Requests for feature enhancements or new features

Comments

@1998kajal
Copy link

(Note, you don't have to fill out every section here. They're just here for guidance. That said, nicely detailed feature requests are more likely to get eng attention sooner)

Problem

Is your feature request related to a problem? Please describe the problem here. Ex. I'm always frustrated when [...]

Solution

MVP: What's the smallest possible solution that would get 80% of the problem out of the way?

Possible additions: What are other things that could be added to the MVP over time to make it better?

Preferred solution: If you don't like the MVP above, tell us why, and what you'd like done instead.

Additional context

Add any other context or screenshots about the feature request here. For exmaple, did this FR come from https://discuss.streamlit.io or another site? Link the original source here!

@1998kajal 1998kajal added the type:enhancement Requests for feature enhancements or new features label Apr 9, 2020
@andfanilo
Copy link
Contributor

andfanilo commented Apr 9, 2020

Hello @1998kajal , thanks for the feature request !

Can you provide additional info on the library you're using to train Decision trees ? For example Scikit-learn Decision Tree provides bindings to Graphviz and Streamlit is able to render Graphviz objects so the following does the trick :

import graphviz as graphviz
from sklearn.datasets import load_iris
from sklearn import tree
import streamlit as st

X, y = load_iris(return_X_y=True)
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, y)

dot_data  = tree.export_graphviz(clf, out_file=None)

st.graphviz_chart(dot_data)

image

@randyzwitch
Copy link
Contributor

Closing this issue, as Fanilo has highlighted that there is a solution and the issue has gone stale. If Fanilo's solution is not sufficient, I invite you to create an issue on our community forum and we can walk through the options there. Thanks for using Streamlit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

4 participants