Skip to content

Commit

Permalink
hide normalize toggle in simple dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
oegedijk committed Jul 8, 2021
1 parent d5a63bb commit 8cc11e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- adds a new toggle and parameter to the ConfusionmatrixComponent to either average
the percentage over the entire matrix, over the rows or over the columns.
Set normalize='all', normalize='true', or normalize='pred'.
- also adds a `save_html(filename)` method to all `ExplainerComponents` and `ExplainerDashboard`
- `ExplainerHub` adds a new parameter `index_to_base_route`:
Dispatches Hub to `/base_route/index` instead of the default `/` and `/index`.
Useful when the host root is not reserved for the ExplainerHub
Expand Down
2 changes: 1 addition & 1 deletion explainerdashboard/dashboard_components/composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def __init__(self, explainer, title="Simple Classifier Explainer", name=None,
super().__init__(explainer, title=title, name=name)

self.confusionmatrix = ConfusionMatrixComponent(explainer,
**update_params(kwargs, hide_percentage=True, hide_selector=True))
**update_params(kwargs, hide_percentage=True, hide_selector=True, hide_normalize=True))

# select custom classifier report metric
if classifier_custom_component == 'metrics':
Expand Down
4 changes: 3 additions & 1 deletion explainerdashboard/explainer_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,19 +1272,21 @@ def plotly_confusion_matrix(cm, labels=None, percentage=True, normalize='all'):
zmin=0, zmax=zmax, colorscale='Blues',
showscale=False,
)]

layout = go.Layout(
title="Confusion Matrix",
xaxis=dict(title='predicted',
constrain="domain",
tickmode = 'array',
showgrid = False,
tickvals = [f" {lab}" for lab in labels],
ticktext = [f" {lab}" for lab in labels]),
yaxis=dict(title=dict(text='observed',standoff=20),
autorange="reversed",
side='left',
scaleanchor='x',
scaleratio=1,
showgrid = False,
tickmode = 'array',
tickvals = [f" {lab}" for lab in labels],
ticktext = [f" {lab}" for lab in labels]),
Expand Down

0 comments on commit 8cc11e7

Please sign in to comment.