Giter Club home page Giter Club logo

Comments (4)

parrt avatar parrt commented on May 14, 2024 1

Ah! Must be spaces in the name, yes!!! Noted.

from dtreeviz.

parrt avatar parrt commented on May 14, 2024

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.

parrt avatar parrt commented on May 14, 2024

Hi @Whamp can you try the above and/or send me a few rows of data that don't work? thanks!

from dtreeviz.

parrt avatar parrt commented on May 14, 2024

Per https://twitter.com/PrinceShiva074/status/1048350134134697984 it's better to use simple node names.

from dtreeviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.