Comments (4)
Ah! Must be spaces in the name, yes!!! Noted.
from dtreeviz.
Hmm...can you send me a single row and a header row of data? Or maybe paste the dot/gv file here? This is working for me in jupyter lab on mac:
from sklearn.datasets import *
from dtreeviz.trees import *
from IPython.display import Image, display_svg
# data from https://archive.ics.uci.edu/ml/datasets/User+Knowledge+Modeling
clf = tree.DecisionTreeClassifier(max_depth=3)
know = pd.read_csv("testing/data/knowledge.csv")
target_names = ['very_low', 'Low', 'Middle', 'High']
know['UN S'] = know['UNS'].copy()
know['P E G'] = know['PEG'].copy()
know = know.drop(['UNS','PEG'], axis=1)
know['UN S'] = know['UN S'].map({n: i for i, n in enumerate(target_names)})
X_train, y_train = know.drop('UN S', axis=1), know['UN S']
clf = clf.fit(X_train, y_train)
viz = dtreeviz(clf,
X_train,
y_train,
target_name='UN S',
feature_names=X_train.columns.values,
class_names=target_names,
fancy=True)
viz
from dtreeviz.
Hi @Whamp can you try the above and/or send me a few rows of data that don't work? thanks!
from dtreeviz.
Per https://twitter.com/PrinceShiva074/status/1048350134134697984 it's better to use simple node names.
from dtreeviz.
Related Issues (20)
- Add support for TensorFlow GradientBoostedTreesModel model
- _regr_leaf_viz calculates the mean for prediction value.
- WARNING:matplotlib.font_manager:findfont: Font family 'Arial' not found. HOT 2
- Decision Tree visualize wrong path HOT 1
- When using dataset that is different from the training for trees models - does not draw HOT 1
- Support for RandomForest HOT 5
- Visualize custom decision tree HOT 1
- how to use dtreeviz in streamlit HOT 2
- VisualisationNotYetSupportedError: get_min_samples_leaf() is not implemented yet for XGBoost. HOT 4
- TypeError: list indices must be integers or slices, not numpy.float64 HOT 5
- Crash when leaf nodes have no samples HOT 1
- Out of memory when calling viz.view() HOT 2
- Integrate AI explanation
- CatBoost need to be supported. HOT 1
- AttributeError: module 'dtreeviz' has no attribute 'model' on Windows platform, works fine on Google colab
- tfdf.keras.CartModel support? HOT 1
- TypeError: 'int' object is not subscriptable HOT 3
- Development requirement in `setup.py` HOT 1
- Adjust Bounding Box of saved svg file
- DTreeViz crashes, if descision tree was built with objects, that are interpretable as numbers.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtreeviz.