KL Web Design
KL Web Design

Reputation: 19

Unusual error when using DTreeviz / Graphviz in Voila Jupyter

I am using voila to create a basic web app for my jupyter notebook. Using the example code for "dtreeviz" which displays a decision tree:

from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier

import dtreeviz

iris = load_iris()
X = iris.data
y = iris.target

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

viz_model = dtreeviz.model(clf,
                           X_train=X, y_train=y,
                           feature_names=iris.feature_names,
                           target_name='iris',
                           class_names=iris.target_names)

viz_model.view()     # render as SVG into internal object 
# display(v)               # pop up window

This works for standard jupyter notebook outputting: enter image description here However in voila it comes up with this error: enter image description here

I have tried allowing all static file formats as shown in the voila documentation but nothing seems to change.

Does anyone have any ideas?

Upvotes: 0

Views: 24

Answers (0)

Related Questions