Skip to content

Instantly share code, notes, and snippets.

@oegedijk
Created February 17, 2021 12:41
Show Gist options
  • Save oegedijk/6ff115856b2a4ea69cf4b50b7b9b6989 to your computer and use it in GitHub Desktop.
Save oegedijk/6ff115856b2a4ea69cf4b50b7b9b6989 to your computer and use it in GitHub Desktop.
from explainerdashboard.custom import *
class CustomDashboard(ExplainerComponent):
def __init__(self, explainer, title="Custom Dashboard"):
super().__init__(explainer)
self.confusion = ConfusionMatrixComponent(explainer,
hide_selector=True, hide_percentage=True, cutoff=0.75)
self.contrib = ShapContributionsGraphComponent(explainer,
hide_selector=True, hide_depth=True, hide_sort=True)
def layout(self):
return dbc.Container([
dbc.Row([
dbc.Col([
html.H1("Custom Demonstration:"),
html.H3("How to build your own layout by re-using ExplainerComponents.")
])
]),
dbc.Row([
dbc.Col([
self.confusion.layout(),
]),
dbc.Col([
self.contrib.layout(),
])
])
])
ExplainerDashboard(explainer, CustomDashboard, hide_header=True).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment