InlineExplainer¶
As a data scientist you often work inside a notebook environment where you
quickly interactively like to explore your data. The InlineExplainer
allows
you to do this by running ExplainerComponents
(or whole tabs) inline
inside your Jupyter notebook (also works in Google Colab!).

This allows you to quickly check model performance, look for shap importances, etc. The components are sorted into subcategories and work with tab-completion.
Example use:
from explainerdashboard import InlineExplainer
ie = InlineExplainer(explainer)
ie.importances()
ie.model_stats()
ie.prediction()
ie.random_index()
ie.tab.importances()
ie.tab.modelsummary()
ie.tab.contributions()
ie.tab.dependence()
ie.tab.interactions()
ie.tab.decisiontrees()
ie.shap.overview()
ie.shap.summary()
ie.shap.dependence()
ie.shap.interaction_overview()
ie.shap.interaction_summary()
ie.shap.interaction_dependence()
ie.shap.contributions_graph()
ie.shap.contributions_table()
ie.classifier.model_stats()
ie.classifier.precision()
ie.classifier.confusion_matrix()
ie.classifier.lift_curve()
ie.classifier.classification()
ie.classifier.roc_auc()
ie.classifier.pr_auc()
ie.regression.model_stats()
ie.regression.pred_vs_actual()
ie.regression.residuals()
ie.regression.plots_vs_col()
ie.decisiontrees.overview()
ie.decisiontrees.decision_trees()
ie.decisiontrees.decisionpath_table()
ie.decisiontrees.decisionpath_graph()
You can also add options for the size of the output width, or to display the component in a separate tab (‘external’), or running on a different port:
InlineExplainer(explainer, mode='external', port=8051, width=1000, height=800).importances()
Note
You can run a component without instantiating the InlineExplainer first,
like for example InlineExplainer(explainer).importances()
, but then you
cannot inspect the kwargs and docstring of that particular component.
So to inspect kwargs and docstring you would run:
ie = InlineExplainer(explainer)
?ie.importances
(or alternatively hit shift-tab in jupyter of course)
You can kill an InlineExplainer
running on a particular port with
ExplainerDashboard.terminate(port=8050)
.
InlineExplainer documentation¶
- class explainerdashboard.dashboards.InlineExplainer(explainer, mode='inline', width=1000, height=800, port=8050, **kwargs)¶
Run a single tab inline in a Jupyter notebook using specific method calls.
- Parameters
explainer (
BaseExplainer
) – an Explainer objectmode (str, optional) – either ‘inline’, ‘jupyterlab’ or ‘external’
width (
int
) – width in pixels of inline iframeheight (
int
) – height in pixels of inline iframeport (
int
) – port to run if mode=’external’
- tab¶
subclass with InlineExplainerTabs layouts, e.g. InlineExplainer(explainer).tab.modelsummary()
- shap¶
subclass with InlineShapExplainer layouts, e.g. InlineExplainer(explainer).shap.dependence()
- classifier¶
subclass with InlineClassifierExplainer plots, e.g. InlineExplainer(explainer).classifier.confusion_matrix()
- regression¶
subclass with InlineRegressionExplainer plots, e.g. InlineExplainer(explainer).regression.residuals()
- decisiontrees¶
subclass with InlineDecisionTreesExplainer plots, e.g. InlineExplainer(explainer).decisiontrees.decisiontrees()
- importances(title='Importances', name=None, subtitle='Which features had the biggest impact?', hide_type=False, hide_depth=False, hide_popout=False, hide_title=False, hide_subtitle=False, hide_selector=False, pos_label=None, importance_type='shap', depth=None, no_permutations=False, description=None)¶
Display features importances component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Importances”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str, optional) – Subtitle.
hide_type (bool, optional) – Hide permutation/shap selector toggle. Defaults to False.
hide_depth (bool, optional) – Hide number of features toggle. Defaults to False.
hide_popout (bool, optional) – hide popout button
hide_title (bool, optional) – hide title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
importance_type (str, {'permutation', 'shap'} optional) – initial importance type to display. Defaults to “shap”.
depth (int, optional) – Initial number of top features to display. Defaults to None (=show all).
no_permutations (bool, optional) – Do not use the permutation importances for this component. Defaults to False.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- model_stats(title='Models Stats', **kwargs)¶
Runs model_stats inline in notebook
- prediction(title='Prediction', name=None, hide_index=False, hide_percentile=False, hide_title=False, hide_subtitle=False, hide_selector=False, pos_label=None, index=None, percentile=True, description=None)¶
Shows a summary for a particular prediction
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Prediction Summary”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_index (bool, optional) – hide index selector. Defaults to False.
hide_percentile (bool, optional) – hide percentile toggle. Defaults to False.
hide_title (bool, optional) – hide title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ({int, str}, optional) – Index to display prediction summary for. Defaults to None.
percentile (bool, optional) – Whether to add the prediction percentile. Defaults to True.
- random_index(title='Random Index', **kwargs)¶
show random index selector inline in notebook
- pdp(title='Partial Dependence Plots', name=None, subtitle='How does the prediction change if you change one feature?', hide_col=False, hide_index=False, hide_title=False, hide_subtitle=False, hide_footer=False, hide_selector=False, hide_popout=False, hide_dropna=False, hide_sample=False, hide_gridlines=False, hide_gridpoints=False, hide_cats_sort=False, index_dropdown=True, feature_input_component=None, pos_label=None, col=None, index=None, dropna=True, sample=100, gridlines=50, gridpoints=10, cats_sort='freq', description=None)¶
Show Partial Dependence Plot component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Partial Dependence Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_col (bool, optional) – Hide feature selector. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_title (bool, optional) – Hide title, Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
hide_popout (bool, optional) – hide popout button
hide_dropna (bool, optional) – Hide drop na’s toggle Defaults to False.
hide_sample (bool, optional) – Hide sample size input. Defaults to False.
hide_gridlines (bool, optional) – Hide gridlines input. Defaults to False.
hide_gridpoints (bool, optional) – Hide gridpounts input. Defaults to False.
hide_cats_sort (bool, optional) – Hide the categorical sorting dropdown. Defaults to False.
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.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
col (str, optional) – Feature to display PDP for. Defaults to None.
index ({int, str}, optional) – Index to add ice line to plot. Defaults to None.
dropna (bool, optional) – Drop rows where values equal explainer.na_fill (usually -999). Defaults to True.
sample (int, optional) – Sample size to calculate average partial dependence. Defaults to 100.
gridlines (int, optional) – Number of ice lines to display in plot. Defaults to 50.
gridpoints (int, optional) – Number of breakpoints on horizontal axis Defaults to 10.
cats_sort (str, optional) – how to sort categories: ‘alphabet’, ‘freq’ or ‘shap’. Defaults to ‘freq’.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- class explainerdashboard.dashboards.InlineExplainerTabs(inline_explainer, name)¶
- importances(title='Importances', name=None, hide_title=True, hide_importances=False, hide_descriptions=False, hide_selector=True)¶
Overview tab of feature importances
Can show both permutation importances and mean absolute shap values.
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Importances”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_title (bool, optional) – hide the title
hide_importances (bool, optional) – hide the ImportancesComponent
hide_descriptions (bool, optional) – hide the FeatureDescriptionsComponent
hide_selector (bool, optional) – hide the post label selector. Defaults to True.
- modelsummary(title='Model Summary', name=None, hide_title=True, hide_modelsummary=False, hide_predsvsactual=False, hide_residuals=False, hide_regvscol=False, logs=False, pred_or_actual='vs_pred', residuals='difference', col=None)¶
Composite for displaying multiple regression related graphs:
predictions vs actual plot
residual plot
residuals vs feature
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Regression Stats”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_title (bool, optional) – hide title. Defaults to True.
hide_modelsummary (bool, optional) – hide RegressionModelSummaryComponent
hide_predsvsactual (bool, optional) – hide PredictedVsActualComponent
hide_residuals (bool, optional) – hide ResidualsComponent
hide_regvscol (bool, optional) – hide RegressionVsColComponent
logs (bool, optional) – Use log axis. Defaults to False.
pred_or_actual (str, optional) – plot residuals vs predictions or vs y (actual). Defaults to “vs_pred”.
residuals (str, {'difference', 'ratio', 'log-ratio'} optional) – How to calcualte residuals. Defaults to ‘difference’.
col ({str, int}, optional) – Feature to use for residuals plot. Defaults to None.
- contributions(title='Contributions', name=None, hide_predindexselector=False, hide_predictionsummary=False, hide_contributiongraph=False, hide_pdp=False, hide_contributiontable=False, hide_title=False, hide_selector=True, index_check=True)¶
Composite for a number of component that deal with individual predictions:
random index selector
prediction summary
shap contributions graph
shap contribution table
pdp graph
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Individual Predictions”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_predindexselector (bool, optional) – hide ClassifierRandomIndexComponent or RegressionRandomIndexComponent
hide_predictionsummary (bool, optional) – hide ClassifierPredictionSummaryComponent or RegressionPredictionSummaryComponent
hide_contributiongraph (bool, optional) – hide ShapContributionsGraphComponent
hide_pdp (bool, optional) – hide PdpComponent
hide_contributiontable (bool, optional) – hide ShapContributionsTableComponent
hide_title (bool, optional) – hide title. Defaults to False.
index_check (bool, optional) – only pass valid indexes from random index selector to feature input. Defaults to True.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
- whatif(title='What if...', name=None, hide_whatifindexselector=False, hide_inputeditor=False, hide_whatifprediction=False, hide_whatifcontributiongraph=False, hide_whatifpdp=False, hide_whatifcontributiontable=False, hide_title=True, hide_selector=True, index_check=True, n_input_cols=4, sort='importance')¶
Composite for the whatif component:
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Individual Predictions”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_title (bool, optional) – hide title. Defaults to True.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_whatifindexselector (bool, optional) – hide ClassifierRandomIndexComponent or RegressionRandomIndexComponent
hide_inputeditor (bool, optional) – hide FeatureInputComponent
hide_whatifprediction (bool, optional) – hide PredictionSummaryComponent
hide_whatifcontributiongraph (bool, optional) – hide ShapContributionsGraphComponent
hide_whatifcontributiontable (bool, optional) – hide ShapContributionsTableComponent
hide_whatifpdp (bool, optional) – hide PdpComponent
index_check (bool, optional) – only pass valid indexes from random index selector to feature input. Defaults to True.
n_input_cols (int, optional) – number of columns to divide the feature inputs into. Defaults to 4.
sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional) – sorting of shap values. Defaults to ‘importance’.
- dependence(title='Shap Dependence', name=None, hide_selector=True, hide_shapsummary=False, hide_shapdependence=False, depth=None)¶
Composite of ShapSummary and ShapDependence component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Dependence”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_shapsummary (bool, optional) – hide ShapSummaryComponent
hide_shapdependence (bool, optional) – ShapDependenceComponent
depth (int, optional) – Number of features to display. Defaults to None.
- interactions(title='Shap Interactions', name=None, hide_selector=True, hide_interactionsummary=False, hide_interactiondependence=False, depth=None)¶
Composite of InteractionSummaryComponent and InteractionDependenceComponent
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Interactions”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_interactionsummary (bool, optional) – hide InteractionSummaryComponent
hide_interactiondependence (bool, optional) – hide InteractionDependenceComponent
depth (int, optional) – Initial number of features to display. Defaults to None.
- decisiontrees(title='Decision Trees', name=None, hide_treeindexselector=False, hide_treesgraph=False, hide_treepathtable=False, hide_treepathgraph=False, hide_selector=True, index_check=True)¶
Composite of decision tree related components:
index selector
individual decision trees barchart
decision path table
deciion path graph
- Parameters
explainer (Explainer) – explainer object constructed with either RandomForestClassifierExplainer() or RandomForestRegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision Trees”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_treeindexselector (bool, optional) – hide ClassifierRandomIndexComponent or RegressionRandomIndexComponent
hide_treesgraph (bool, optional) – hide DecisionTreesComponent
hide_treepathtable (bool, optional) – hide DecisionPathTableComponent
hide_treepathgraph (bool, optional) – DecisionPathGraphComponent
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
index_check (bool, optional) – only pass valid indexes from random index selector to feature input. Defaults to True.
- class explainerdashboard.dashboards.InlineShapExplainer(inline_explainer, name)¶
- overview(title='Shap Overview', name=None, hide_selector=True, hide_shapsummary=False, hide_shapdependence=False, depth=None)¶
Composite of ShapSummary and ShapDependence component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Dependence”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_shapsummary (bool, optional) – hide ShapSummaryComponent
hide_shapdependence (bool, optional) – ShapDependenceComponent
depth (int, optional) – Number of features to display. Defaults to None.
- summary(title='Shap Summary', name=None, subtitle='Ordering features by shap value', hide_title=False, hide_subtitle=False, hide_depth=False, hide_type=False, hide_index=False, hide_selector=False, hide_popout=False, pos_label=None, depth=None, summary_type='aggregate', max_cat_colors=5, index=None, plot_sample=None, description=None)¶
Shows shap summary component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Shap Dependence Summary”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide the title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_depth (bool, optional) – hide the depth toggle. Defaults to False.
hide_type (bool, optional) – hide the summary type toggle (aggregated, detailed). Defaults to False.
hide_popout (bool, optional) – hide popout button
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
depth (int, optional) – initial number of features to show. Defaults to None.
summary_type (str, {'aggregate', 'detailed'}. optional) – type of summary graph to show. Defaults to “aggregate”.
max_cat_colors (int, optional) – for categorical features, maximum number of categories to label with own color. Defaults to 5.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- dependence(title='Shap Dependence', name=None, subtitle='Relationship between feature value and SHAP value', hide_title=False, hide_subtitle=False, hide_col=False, hide_color_col=False, hide_index=False, hide_selector=False, hide_outliers=False, hide_cats_topx=False, hide_cats_sort=False, hide_popout=False, hide_footer=False, pos_label=None, col=None, color_col=None, index=None, remove_outliers=False, cats_topx=10, cats_sort='freq', max_cat_colors=5, plot_sample=None, description=None)¶
Show shap dependence graph
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Shap Dependence”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide component title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_col (bool, optional) – hide feature selector. Defaults to False.
hide_color_col (bool, optional) – hide color feature selector Defaults to False.
hide_index (bool, optional) – hide index selector Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_cats_topx (bool, optional) – hide the categories topx input. Defaults to False.
hide_cats_sort (bool, optional) – hide the categories sort selector.Defaults to False.
hide_outliers (bool, optional) – Hide remove outliers toggle input. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
hide_footer (bool, optional) – hide the footer.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
col (str, optional) – Feature to display. Defaults to None.
color_col (str, optional) – Color plot by values of this Feature. Defaults to None.
index (int, optional) – Highlight a particular index. Defaults to None.
remove_outliers (bool, optional) – remove outliers in feature and color feature from the plot.
cats_topx (int, optional) – maximum number of categories to display for categorical features. Defaults to 10.
cats_sort (str, optional) – how to sort categories: ‘alphabet’, ‘freq’ or ‘shap’. Defaults to ‘freq’.
max_cat_colors (int, optional) – for categorical features, maximum number of categories to label with own color. Defaults to 5.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- interaction_overview(title='Interactions Overview', name=None, hide_selector=True, hide_interactionsummary=False, hide_interactiondependence=False, depth=None)¶
Composite of InteractionSummaryComponent and InteractionDependenceComponent
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Feature Interactions”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_interactionsummary (bool, optional) – hide InteractionSummaryComponent
hide_interactiondependence (bool, optional) – hide InteractionDependenceComponent
depth (int, optional) – Initial number of features to display. Defaults to None.
- interaction_summary(title='Shap Interaction Summary', name=None, subtitle='Ordering features by shap interaction value', hide_title=False, hide_subtitle=False, hide_col=False, hide_depth=False, hide_type=False, hide_index=False, hide_popout=False, hide_selector=False, pos_label=None, col=None, depth=None, summary_type='aggregate', max_cat_colors=5, index=None, plot_sample=None, description=None)¶
Show SHAP Interaciton values summary component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Interactions Summary”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide the component title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_col (bool, optional) – Hide the feature selector. Defaults to False.
hide_depth (bool, optional) – Hide depth toggle. Defaults to False.
hide_type (bool, optional) – Hide summary type toggle. Defaults to False.
hide_index (bool, optional) – Hide the index selector. Defaults to False
hide_popout (bool, optional) – hide popout button
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
col (str, optional) – Feature to show interaction summary for. Defaults to None.
depth (int, optional) – Number of interaction features to display. Defaults to None.
summary_type (str, {'aggregate', 'detailed'}, optional) – type of summary graph to display. Defaults to “aggregate”.
max_cat_colors (int, optional) – for categorical features, maximum number of categories to label with own color. Defaults to 5.
index (str) – Default index. Defaults to None.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- interaction_dependence(title='Shap Interaction Dependence', name=None, subtitle='Relation between feature value and shap interaction value', hide_title=False, hide_subtitle=False, hide_col=False, hide_interact_col=False, hide_index=False, hide_popout=False, hide_selector=False, hide_outliers=False, hide_cats_topx=False, hide_cats_sort=False, hide_top=False, hide_bottom=False, pos_label=None, col=None, interact_col=None, remove_outliers=False, cats_topx=10, cats_sort='freq', max_cat_colors=5, plot_sample=None, description=None, index=None)¶
Interaction Dependence Component.
- Shows two graphs:
top graph: col vs interact_col bottom graph: interact_col vs col
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Interactions Dependence”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – Hide component title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_col (bool, optional) – Hide feature selector. Defaults to False.
hide_interact_col (bool, optional) – Hide interaction feature selector. Defaults to False.
hide_highlight (bool, optional) – Hide highlight index selector. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_outliers (bool, optional) – Hide remove outliers toggle input. Defaults to False.
hide_popout (bool, optional) – hide popout button
hide_cats_topx (bool, optional) – hide the categories topx input. Defaults to False.
hide_cats_sort (bool, optional) – hide the categories sort selector. Defaults to False.
hide_top (bool, optional) – Hide the top interaction graph (col vs interact_col). Defaults to False.
hide_bottom (bool, optional) – hide the bottom interaction graph (interact_col vs col). Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
col (str, optional) – Feature to find interactions for. Defaults to None.
interact_col (str, optional) – Feature to interact with. Defaults to None.
highlight (int, optional) – Index row to highlight Defaults to None.
remove_outliers (bool, optional) – remove outliers in feature and color feature from the plot.
cats_topx (int, optional) – number of categories to display for categorical features.
cats_sort (str, optional) – how to sort categories: ‘alphabet’, ‘freq’ or ‘shap’. Defaults to ‘freq’.
max_cat_colors (int, optional) – for categorical features, maximum number of categories to label with own color. Defaults to 5.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- contributions_graph(title='Contributions', name=None, subtitle='How has each feature contributed to the prediction?', hide_title=False, hide_subtitle=False, hide_index=False, hide_depth=False, hide_sort=False, hide_orientation=True, hide_selector=False, hide_popout=False, feature_input_component=None, index_dropdown=True, pos_label=None, index=None, depth=None, sort='high-to-low', orientation='vertical', higher_is_better=True, description=None)¶
Display Shap contributions to prediction graph component
- Parameters
explainer (Explainer) – explainer object constructed , with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Contributions Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – Hide component title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_depth (bool, optional) – Hide depth toggle. Defaults to False.
hide_sort (bool, optional) – Hide the sorting dropdown. Defaults to False.
hide_orientation (bool, optional) – Hide the orientation dropdown. Defaults to True.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button
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.
index_dropdown (bool, optional) – Use dropdown for index input instead of free text input. Defaults to True.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ({int, bool}, optional) – Initial index to display. Defaults to None.
depth (int, optional) – Initial number of features to display. Defaults to None.
sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional) – sorting of shap values. Defaults to ‘high-to-low’.
orientation ({'vertical', 'horizontal'}, optional) – orientation of bar chart. Defaults to ‘vertical’.
higher_is_better (bool, optional) – Color positive shap values green and negative shap values red, or the reverse.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- contributions_table(title='Contributions', name=None, subtitle='How has each feature contributed to the prediction?', hide_title=False, hide_subtitle=False, hide_index=False, hide_depth=False, hide_sort=False, hide_selector=False, feature_input_component=None, index_dropdown=True, pos_label=None, index=None, depth=None, sort='abs', description=None)¶
Show SHAP values contributions to prediction in a table component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Contributions Table”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – Hide component title. Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_depth (bool, optional) – Hide depth selector. Defaults to False.
hide_sort (bool, optional) – Hide sorting dropdown. Default to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
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.
index_dropdown (bool, optional) – Use dropdown for index input instead of free text input. Defaults to True.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ([type], optional) – Initial index to display. Defaults to None.
depth ([type], optional) – Initial number of features to display. Defaults to None.
sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional) – sorting of shap values. Defaults to ‘high-to-low’.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- class explainerdashboard.dashboards.InlineClassifierExplainer(inline_explainer, name)¶
- model_stats(title='Models Stats', name=None, hide_title=True, hide_selector=True, hide_globalcutoff=False, hide_modelsummary=False, hide_confusionmatrix=False, hide_precision=False, hide_classification=False, hide_rocauc=False, hide_prauc=False, hide_liftcurve=False, hide_cumprecision=False, pos_label=None, bin_size=0.1, quantiles=10, cutoff=0.5)¶
- Composite of multiple classifier related components:
precision graph
confusion matrix
lift curve
classification graph
roc auc graph
pr auc graph
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision Trees”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_title (bool, optional) – hide title. Defaults to True.
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
hide_globalcutoff (bool, optional) – hide CutoffPercentileComponent
hide_modelsummary (bool, optional) – hide ClassifierModelSummaryComponent
hide_confusionmatrix (bool, optional) – hide ConfusionMatrixComponent
hide_precision (bool, optional) – hide PrecisionComponent
hide_classification (bool, optional) – hide ClassificationComponent
hide_rocauc (bool, optional) – hide RocAucComponent
hide_prauc (bool, optional) – hide PrAucComponent
hide_liftcurve (bool, optional) – hide LiftCurveComponent
hide_cumprecision (bool, optional) – hide CumulativePrecisionComponent
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
bin_size (float, optional) – bin_size for precision plot. Defaults to 0.1.
quantiles (int, optional) – number of quantiles for precision plot. Defaults to 10.
cutoff (float, optional) – initial cutoff. Defaults to 0.5.
- precision(title='Precision Plot', name=None, subtitle='Does fraction positive increase with predicted probability?', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_binsize=False, hide_binmethod=False, hide_multiclass=False, hide_selector=False, hide_popout=False, pos_label=None, bin_size=0.1, quantiles=10, cutoff=0.5, quantiles_or_binsize='bin_size', multiclass=False, description=None)¶
Shows a precision graph with toggles.
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Precision Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – Hide cutoff slider. Defaults to False.
hide_binsize (bool, optional) – hide binsize/quantiles slider. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_binmethod (bool, optional) – Hide binsize/quantiles toggle. Defaults to False.
hide_multiclass (bool, optional) – Hide multiclass toggle. Defaults to False.
hide_selector – Hide pos label selector. Default to True.
hide_popout (bool, optional) – hide popout button
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
bin_size (float, optional) – Size of bins in probability space. Defaults to 0.1.
quantiles (int, optional) – Number of quantiles to divide plot. Defaults to 10.
cutoff (float, optional) – Cutoff to display in graph. Defaults to 0.5.
quantiles_or_binsize (str, {'quantiles', 'bin_size'}, optional) – Default bin method. Defaults to ‘bin_size’.
multiclass (bool, optional) – Display all classes. Defaults to False.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- cumulative_precision(title='Cumulative Precision Plot', name=None, subtitle='Expected distribution for highest scores', hide_title=False, hide_subtitle=False, hide_footer=False, hide_selector=False, hide_popout=False, pos_label=None, hide_cutoff=False, cutoff=None, hide_percentile=False, percentile=None, description=None)¶
Show cumulative precision component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Cumulative Precision”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide the title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
- confusion_matrix(title='Confusion Matrix', name=None, subtitle='How many false positives and false negatives?', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_percentage=False, hide_binary=False, hide_selector=False, hide_popout=False, hide_normalize=False, normalize='all', pos_label=None, cutoff=0.5, percentage=True, binary=True, description=None)¶
Display confusion matrix component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Confusion Matrix”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – Hide cutoff slider. Defaults to False.
hide_percentage (bool, optional) – Hide percentage toggle. Defaults to False.
hide_binary (bool, optional) – Hide binary toggle. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
cutoff (float, optional) – Default cutoff. Defaults to 0.5.
percentage (bool, optional) – Display percentages instead of counts. Defaults to True.
binary (bool, optional) – Show binary instead of multiclass confusion matrix. Defaults to True.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
normalize (str[‘true’, ‘pred’, ‘all’]) – normalizes confusion matrix over the true (rows), predicted (columns) conditions or all the population. Defaults to all
- lift_curve(title='Lift Curve', name=None, subtitle='Performance how much better than random?', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_percentage=False, hide_wizard=False, hide_selector=False, hide_popout=False, pos_label=None, cutoff=0.5, percentage=True, wizard=True, description=None)¶
Show liftcurve component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Lift Curve”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – Hide cutoff slider. Defaults to False.
hide_percentage (bool, optional) – Hide percentage toggle. Defaults to False.
hide_wizard (bool, optional) – hide the wizard toggle. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
cutoff (float, optional) – Cutoff for lift curve. Defaults to 0.5.
percentage (bool, optional) – Display percentages instead of counts. Defaults to True.
wizard (bool, optional) – display the wizard in the graph.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- classification(title='Classification', name=None, subtitle='Distribution of labels above and below cutoff', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_percentage=False, hide_selector=False, hide_popout=False, pos_label=None, cutoff=0.5, percentage=True, description=None)¶
Shows a barchart of the number of classes above the cutoff and below the cutoff.
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Classification Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide the title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – Hide cutoff slider. Defaults to False.
hide_percentage (bool, optional) – Hide percentage toggle. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
cutoff (float, optional) – Cutoff for prediction. Defaults to 0.5.
percentage (bool, optional) – Show percentage instead of counts. Defaults to True.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- roc_auc(title='ROC AUC Curve', name=None, subtitle='Trade-off between False positives and false negatives', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_selector=False, hide_popout=False, pos_label=None, cutoff=0.5, description=None)¶
Show ROC AUC curve component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “ROC AUC Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – Hide cutoff slider. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
cutoff (float, optional) – default cutoff. Defaults to 0.5.
- pr_auc(title='PR AUC Curve', name=None, subtitle='Trade-off between Precision and Recall', hide_title=False, hide_subtitle=False, hide_footer=False, hide_cutoff=False, hide_selector=False, hide_popout=False, pos_label=None, cutoff=0.5, description=None)¶
Display PR AUC plot component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “PR AUC Plot”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_cutoff (bool, optional) – hide cutoff slider. Defaults to False.
hide_selector (bool, optional) – hide pos label selector. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
cutoff (float, optional) – default cutoff. Defaults to 0.5.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- class explainerdashboard.dashboards.InlineRegressionExplainer(inline_explainer, name)¶
- model_stats(title='Models Stats', name=None, hide_title=True, hide_modelsummary=False, hide_predsvsactual=False, hide_residuals=False, hide_regvscol=False, logs=False, pred_or_actual='vs_pred', residuals='difference', col=None)¶
Composite for displaying multiple regression related graphs:
predictions vs actual plot
residual plot
residuals vs feature
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Regression Stats”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_title (bool, optional) – hide title. Defaults to True.
hide_modelsummary (bool, optional) – hide RegressionModelSummaryComponent
hide_predsvsactual (bool, optional) – hide PredictedVsActualComponent
hide_residuals (bool, optional) – hide ResidualsComponent
hide_regvscol (bool, optional) – hide RegressionVsColComponent
logs (bool, optional) – Use log axis. Defaults to False.
pred_or_actual (str, optional) – plot residuals vs predictions or vs y (actual). Defaults to “vs_pred”.
residuals (str, {'difference', 'ratio', 'log-ratio'} optional) – How to calcualte residuals. Defaults to ‘difference’.
col ({str, int}, optional) – Feature to use for residuals plot. Defaults to None.
- pred_vs_actual(title='Predicted vs Actual', name=None, subtitle='How close is the predicted value to the observed?', hide_title=False, hide_subtitle=False, hide_log_x=False, hide_log_y=False, hide_popout=False, logs=False, log_x=False, log_y=False, round=3, plot_sample=None, description=None)¶
Shows a plot of predictions vs y.
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Predicted vs Actual”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) –
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_log_x (bool, optional) – Hide the log_x toggle. Defaults to False.
hide_log_y (bool, optional) – Hide the log_y toggle. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
logs (bool, optional) – Whether to use log axis. Defaults to False.
log_x (bool, optional) – log only x axis. Defaults to False.
log_y (bool, optional) – log only y axis. Defaults to False.
round (int, optional) – rounding to apply to float predictions. Defaults to 3.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- residuals(title='Residuals', name=None, subtitle='How much is the model off?', hide_title=False, hide_subtitle=False, hide_footer=False, hide_pred_or_actual=False, hide_ratio=False, hide_popout=False, pred_or_actual='vs_pred', residuals='difference', round=3, plot_sample=None, description=None)¶
Residuals plot component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Residuals”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) –
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_pred_or_actual (bool, optional) – hide vs predictions or vs actual for x-axis toggle. Defaults to False.
hide_ratio (bool, optional) – hide residual type dropdown. Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
pred_or_actual (str, {'vs_actual', 'vs_pred'}, optional) – Whether to plot actual or predictions on the x-axis. Defaults to “vs_pred”.
residuals (str, {'difference', 'ratio', 'log-ratio'} optional) – How to calcualte residuals. Defaults to ‘difference’.
round (int, optional) – rounding to apply to float predictions. Defaults to 3.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- plots_vs_col(title='Plots vs col', name=None, subtitle='Are predictions and residuals correlated with features?', hide_title=False, hide_subtitle=False, hide_footer=False, hide_col=False, hide_ratio=False, hide_points=False, hide_winsor=False, hide_cats_topx=False, hide_cats_sort=False, hide_popout=False, col=None, display='difference', round=3, points=True, winsor=0, cats_topx=10, cats_sort='freq', plot_sample=None, description=None)¶
Show residuals, observed or preds vs a particular Feature component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Plot vs feature”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) –
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_footer (bool, optional) – hide the footer at the bottom of the component
hide_col (bool, optional) – Hide de column selector. Defaults to False.
hide_ratio (bool, optional) – Hide the toggle. Defaults to False.
hide_points (bool, optional) – Hide group points toggle. Defaults to False.
hide_winsor (bool, optional) – Hide winsor input. Defaults to False.
hide_cats_topx (bool, optional) – hide the categories topx input. Defaults to False.
hide_cats_sort (bool, optional) – hide the categories sort selector.Defaults to False.
hide_popout (bool, optional) – hide popout button. Defaults to False.
col ([type], optional) – Initial feature to display. Defaults to None.
display (str, {'observed', 'predicted', difference', 'ratio', 'log-ratio'} optional) – What to display on y axis. Defaults to ‘difference’.
round (int, optional) – rounding to apply to float predictions. Defaults to 3.
points (bool, optional) – display point cloud next to violin plot for categorical cols. Defaults to True
winsor (int, 0-50, optional) – percentage of outliers to winsor out of the y-axis. Defaults to 0.
cats_topx (int, optional) – maximum number of categories to display for categorical features. Defaults to 10.
cats_sort (str, optional) – how to sort categories: ‘alphabet’, ‘freq’ or ‘shap’. Defaults to ‘freq’.
plot_sample (int, optional) – Instead of all points only plot a random sample of points. Defaults to None (=all points)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- class explainerdashboard.dashboards.InlineDecisionTreesExplainer(inline_explainer, name)¶
- overview(title='Decision Trees', name=None, hide_treeindexselector=False, hide_treesgraph=False, hide_treepathtable=False, hide_treepathgraph=False, hide_selector=True, index_check=True)¶
Composite of decision tree related components:
index selector
individual decision trees barchart
decision path table
deciion path graph
- Parameters
explainer (Explainer) – explainer object constructed with either RandomForestClassifierExplainer() or RandomForestRegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision Trees”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
hide_treeindexselector (bool, optional) – hide ClassifierRandomIndexComponent or RegressionRandomIndexComponent
hide_treesgraph (bool, optional) – hide DecisionTreesComponent
hide_treepathtable (bool, optional) – hide DecisionPathTableComponent
hide_treepathgraph (bool, optional) – DecisionPathGraphComponent
hide_selector (bool, optional) – hide all pos label selectors. Defaults to True.
index_check (bool, optional) – only pass valid indexes from random index selector to feature input. Defaults to True.
- decisiontrees(title='Decision Trees', name=None, subtitle='Displaying individual decision trees', hide_title=False, hide_subtitle=False, hide_index=False, hide_highlight=False, hide_selector=False, hide_popout=False, index_dropdown=True, pos_label=None, index=None, highlight=None, higher_is_better=True, description=None)¶
Show prediction from individual decision trees inside RandomForest component
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision Trees”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title, Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_highlight (bool, optional) – Hide tree highlight selector. Defaults to False.
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
hide_popout (bool, optional) – hide popout button
index_dropdown (bool, optional) – Use dropdown for index input instead of free text input. Defaults to True.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ({str, int}, optional) – Initial index to display. Defaults to None.
highlight (int, optional) – Initial tree to highlight. Defaults to None.
higher_is_better (bool, optional) – up is green, down is red. If False flip the colors. (for gbm models only)
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- decisionpath_table(title='Decision path', name=None, subtitle='Decision path through decision tree', hide_title=False, hide_subtitle=False, hide_index=False, hide_highlight=False, hide_selector=False, index_dropdown=True, pos_label=None, index=None, highlight=None, description=None)¶
Display a table of the decision path through a particular decision tree
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision path table”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title, Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_highlight (bool, optional) – Hide tree index selector. Defaults to False.
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
index_dropdown (bool, optional) – Use dropdown for index input instead of free text input. Defaults to True.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ({str, int}, optional) – Initial index to display decision path for. Defaults to None.
highlight (int, optional) – Initial tree idx to display decision path for. Defaults to None.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.
- decisionpath_graph(title='Decision path', name=None, subtitle='Decision path through decision tree', hide_title=False, hide_subtitle=False, hide_index=False, hide_highlight=False, hide_selector=False, index_dropdown=True, pos_label=None, index=None, highlight=None, description=None)¶
Display a table of the decision path through a particular decision tree
- Parameters
explainer (Explainer) – explainer object constructed with either ClassifierExplainer() or RegressionExplainer()
title (str, optional) – Title of tab or page. Defaults to “Decision path table”.
name (str, optional) – unique name to add to Component elements. If None then random uuid is generated to make sure it’s unique. Defaults to None.
subtitle (str) – subtitle
hide_title (bool, optional) – hide title, Defaults to False.
hide_subtitle (bool, optional) – Hide subtitle. Defaults to False.
hide_index (bool, optional) – Hide index selector. Defaults to False.
hide_highlight (bool, optional) – Hide tree index selector. Defaults to False.
hide_selector (bool, optional) – hide pos label selectors. Defaults to False.
index_dropdown (bool, optional) – Use dropdown for index input instead of free text input. Defaults to True.
pos_label ({int, str}, optional) – initial pos label. Defaults to explainer.pos_label
index ({str, int}, optional) – Initial index to display decision path for. Defaults to None.
highlight (int, optional) – Initial tree idx to display decision path for. Defaults to None.
description (str, optional) – Tooltip to display when hover over component title. When None default text is shown.