Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oegedijk committed May 19, 2021
1 parent d6e2853 commit 07b433d
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ ExplainerDashboard(explainer).run()
metrics will obviously not be available: `ExplainerDashboard(ClassifierExplainer(model, X_test)).run()`.

For a simplified single page dashboard try `ExplainerDashboard(explainer, simple=True)`.

<details><summary>Show simplified dashboard screenshot</summary>
<p>


![docs/source/screenshots/simple_classifier_dashboard.png](docs/source/screenshots/simple_classifier_dashboard.png)

</p>
</details>
<p></p>

### ExplainerHub

You can combine multiple dashboards and host them in a single place using
Expand All @@ -157,13 +168,21 @@ hub = ExplainerHub([db1, db2])
hub.run()
```

![docs/source/screenshots/explainerhub.png](docs/source/screenshots/explainerhub.png)


You can adjust titles and descriptions, manage users and logins, store and load
from config, manage the hub through a CLI and more. See the
[ExplainerHub documentation](https://explainerdashboard.readthedocs.io/en/latest/hub.html).

<details><summary>Show ExplainerHub screenshot</summary>
<p>


![docs/source/screenshots/explainerhub.png](docs/source/screenshots/explainerhub.png)

</p>
</details>
<p></p>


### Dealing with slow calculations

Some of the calculations for the dashboard such as calculating SHAP (interaction) values
Expand Down Expand Up @@ -405,6 +424,18 @@ class CustomDashboard(ExplainerComponent):
db = ExplainerDashboard(explainer, CustomDashboard, hide_header=True).run()
```

<details><summary>Show example custom dashboard screenshot</summary>
<p>


![docs/source/screenshots/custom_dashboard.png](docs/source/screenshots/custom_dashboard.png)

</p>

</details>
<p></p>


You can use this to define your own layouts, specifically tailored to your
own model, project and needs. You can use the [ExplainerComposites](https://github.com/oegedijk/explainerdashboard/blob/master/explainerdashboard/dashboard_components/composites.py) that
are used for the tabs of the default dashboard as a starting point, and edit
Expand Down
20 changes: 20 additions & 0 deletions docs/source/dashboards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ all the default tabs that are compatible with your ``model`` and ``model_output`
.. image:: screenshots/screenshot.png


Simplified single page dashboard
--------------------------------

For a simplified single page dashboard, use::

ExplainerDashboard(explainer, simple=True).run()


.. raw:: html

<details>
<summary>screenshot</summary><p>

.. image:: screenshots/simple_classifier_dashboard.png

.. raw:: html

</p></details>
<p></p>

Switching off tabs with booleans
--------------------------------

Expand Down
44 changes: 44 additions & 0 deletions docs/source/hub.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,50 @@ url path with ``name``::
description="Showing dashboards for both model one and two")
hub.run()

Adding dashboards
=================

You can add additional dashboards to a hub with::

hub.add_dashboard(db2)

And remove them by passing their name::

hub.remove_dashboard("db2")

Adding dashboards using url
---------------------------

You can even add dashboards to a running dashboard by navigating to the ``/add_dashboard``
route and specifying the path to a ``.yaml`` file::

db2.to_yaml("dashboards/dashboard2.yaml", dump_explainer=True)
ExplainerHub([db1], add_dashboard_route=True).run()

If you then navigate to ``http://localhost:8050/add_dashboard/dashboards/dashboard2.yaml`` then
this dashboard will be added to the hub. By default you can specify any ``.yaml`` file
in any sub directory in which the hub is running.

This can be useful when you for example store explainers and dashboards as part of
an MLOps or CI/CD flow.

If you store dashboards in a particular location, you can also specify a pattern to
add dashboards::

ExplainerHub([db1],
add_dashboard_route=True,
add_dashboard_pattern="dashboards/{}.yaml").run()

Now you can simply nagivate to ``http://localhost:8050/add_dashboard/dashboard2`` and it will
find``dashboards/dashboard2.yaml`` and add it.

You can also remove dashboards by navigating to e.g. ``http://localhost:8050/remove_dashboard/db2``.

.. note::
Dashboards will be added to a particular instance of the hub that is running.
So if you have a deployment with multiple workers/nodes, this method will not work
for now.

Changing size, theme, etc
==========================

Expand Down
5 changes: 5 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ Or, as a one-liner::
The result of the lines above can be seen in the screenshot above or can be
viewed on `this example dashboard deployed to heroku. <http://titanicexplainer.herokuapp.com>`_

For a more simple single tab dashboard try::

ExplainerDashboard(explainer, simple=True).run()


Custom dashboards
=================
You can easily :ref:`remix and customize<CustomModelTab>` ``ExplainerComponent`` primitives into
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/source/tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ DecisionTreesComposite
SimplifiedClassifierComposite
=============================

.. raw:: html

<details>
<summary>screenshot</summary><p>

.. image:: screenshots/simple_classifier_dashboard.png

.. raw:: html

</p></details>
<p></p>

You can also load this composite with::

explainer = ClassifierExplainer(model, X, y)
Expand All @@ -93,6 +105,18 @@ You can also load this composite with::
SimplifiedRegressionComposite
=============================

.. raw:: html

<details>
<summary>screenshot</summary><p>

.. image:: screenshots/simple_regression_dashboard.png

.. raw:: html

</p></details>
<p></p>

You can also load this composite with::

explainer = RegressionExplainer(model, X, y)
Expand Down

0 comments on commit 07b433d

Please sign in to comment.