You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In contrast with the linear models and EBM which give a Plotly Figure back when running .visualise() on an explainer object, the decision tree (classifier and regressor) give back a Cytoscape object. The plotly figure is downloadable but for the Cytoscape object I have not figured it out.
Is this difference on purpose?
Is there a way to download the decision tree explainer objects?
Code to show both objects:
import numpy as np
from sklearn.datasets import make_classification
from interpret.glassbox import ClassificationTree, ExplainableBoostingClassifier
# Generate fake classification data
X, y = make_classification(n_samples=1000, n_features=10, n_informative=3, n_redundant=2, random_state=42)
# Train an EBM model
ebm = ExplainableBoostingClassifier(random_state=42)
ebm.fit(X, y)
# Create a global explanation object
ebm_global_explanation = ebm.explain_global()
# Print the global explanation
print(ebm_global_explanation.visualize())
# Train an interpretable decision tree classifier
tree = ClassificationTree(random_state=42)
tree.fit(X, y)
# Create a global explanation object
tree_global_explanation = tree.explain_global()
# Print the global explanation
print(tree_global_explanation.visualize())
The text was updated successfully, but these errors were encountered:
Hi @kaspersgit -- @Harsha-Nori and @nopdive are the experts on this section of the code, but my limited understanding is that plotly was designed for X/Y plots, but not for directed graphs like a decision tree, so they used Cytoscape for that. I think the answer to your question about outputting them as text is that you can't, but I'll defer to Harsha and Sam on that one. You should be able to pickle them though I would think if you just wanted serialization.
In contrast with the linear models and EBM which give a Plotly Figure back when running .visualise() on an explainer object, the decision tree (classifier and regressor) give back a Cytoscape object. The plotly figure is downloadable but for the Cytoscape object I have not figured it out.
Is this difference on purpose?
Is there a way to download the decision tree explainer objects?
Code to show both objects:
The text was updated successfully, but these errors were encountered: