Skip to content

Commit

Permalink
Merge pull request #91 from oegedijk/dev
Browse files Browse the repository at this point in the history
v0.3.2.1
  • Loading branch information
oegedijk authored Feb 26, 2021
2 parents 3884b8e + 3aedffa commit 05dfa18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 13 additions & 11 deletions explainerdashboard/dashboard_components/regression_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, explainer, title=None, name=None,
hide_index=False, hide_pred_slider=False,
hide_residual_slider=False, hide_pred_or_y=False,
hide_abs_residuals=False, hide_button=False,
index=None, pred_slider=None, y_slider=None,
index_dropdown=True, index=None, pred_slider=None, y_slider=None,
residual_slider=None, abs_residual_slider=None,
pred_or_y="preds", abs_residuals=True, round=2,
description=None, **kwargs):
Expand Down Expand Up @@ -56,6 +56,8 @@ def __init__(self, explainer, title=None, name=None,
hide_abs_residuals (bool, optional): hide absolute residuals toggle.
Defaults to False.
hide_button (bool, optional): hide button. Defaults to False.
index_dropdown (bool, optional): Use dropdown for index input instead
of free text input. Defaults to True.
index ({str, int}, optional): Initial index to display.
Defaults to None.
pred_slider ([lb, ub], optional): Initial values for prediction
Expand Down Expand Up @@ -84,6 +86,8 @@ def __init__(self, explainer, title=None, name=None,
self.title = f"Select {self.explainer.index_name}"

self.index_name = 'random-index-reg-index-'+self.name
self.index_selector = IndexSelector(explainer, self.index_name,
index=index, index_dropdown=index_dropdown)

if self.explainer.y_missing:
self.hide_residual_slider = True
Expand Down Expand Up @@ -156,10 +160,7 @@ def layout(self):
dbc.Row([
make_hideable(
dbc.Col([
dcc.Dropdown(id='random-index-reg-index-'+self.name,
options = [{'label': str(idx), 'value':idx}
for idx in self.explainer.get_index_list()],
value=self.index)
self.index_selector.layout()
], md=8), hide=self.hide_index),
make_hideable(
dbc.Col([
Expand Down Expand Up @@ -392,8 +393,8 @@ def update_index(n_clicks, pred_range, y_range, residual_range, abs_residuals_ra
class RegressionPredictionSummaryComponent(ExplainerComponent):
def __init__(self, explainer, title="Prediction", name=None,
hide_index=False, hide_title=False,
hide_subtitle=False, hide_table=False,
feature_input_component=None,
hide_subtitle=False, hide_table=False,
index_dropdown=True, feature_input_component=None,
index=None, round=3, description=None,
**kwargs):
"""Shows a summary for a particular prediction
Expand All @@ -410,6 +411,8 @@ def __init__(self, explainer, title="Prediction", name=None,
hide_title (bool, optional): hide title. Defaults to False.
hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
hide_table (bool, optional): hide the results table
index_dropdown (bool, optional): Use dropdown for index input instead
of free text input. Defaults to True.
feature_input_component (FeatureInputComponent): A FeatureInputComponent
that will give the input to the graph instead of the index selector.
If not None, hide_index=True. Defaults to None.
Expand All @@ -420,6 +423,8 @@ def __init__(self, explainer, title="Prediction", name=None,
super().__init__(explainer, title, name)

self.index_name = 'reg-prediction-index-'+self.name
self.index_selector = IndexSelector(explainer, self.index_name,
index=index, index_dropdown=index_dropdown)

if self.feature_input_component is not None:
self.exclude_callbacks(self.feature_input_component)
Expand All @@ -442,10 +447,7 @@ def layout(self):
make_hideable(
dbc.Col([
dbc.Label(f"{self.explainer.index_name}:"),
dcc.Dropdown(id='reg-prediction-index-'+self.name,
options = [{'label': str(idx), 'value':idx}
for idx in self.explainer.get_index_list()],
value=self.index)
self.index_selector.layout(),
], md=6), hide=self.hide_index),
]),
dbc.Row([
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='explainerdashboard',
version='0.3.2',
version='0.3.2.1',
description='Quickly build Explainable AI dashboards that show the inner workings of so-called "blackbox" machine learning models.',
long_description="""
Expand Down

0 comments on commit 05dfa18

Please sign in to comment.