xai_dashboard#
- class predict_backend.page.elements.xai_dashboard.XAIDashboard(model, explainer, plot_data, x_axis_key, y_axis_key, pred_column, title='', description='', bounds=None, waterfall_positive_color=None, waterfall_negative_color=None, expected_title=None, predicted_title=None, top_n=None, train_data=None, encoding=None, color_by_category=False, show_title=True, show_description=True)#
Bases:
Element
An XAI Dashboard to show the Scenario Planning Tool which allows users to interact with their data an explore scenarios that may have not been included in the original dataset. Using an existing
Model
andDataset
users can create potential new scenarios and use XAI to analyze the model’s prediction for these new inputs.- Parameters:
model (
Model
) – The model that is performing predictions on the data points.explainer (
Explainer
) – The explainer to use for the model.plot_data (
Dataset
) – The data to show on the plot.x_axis_key (
str
) – The key for the X-axis on this plot.y_axis_key (
str
) – The key for the Y-axis on this plot.pred_column (
str
) – The column in the data the prediction lies on.title (
str
) – The title of the element, defaults to ‘’.description (
str
) – The element’s description, defaults to ‘’.bounds (
Optional
[Dict
[str
,List
[Union
[str
,int
]]]]) – An optional Dict of the bounds for the data. The keys will be column names and the values will be list that represent the domain, defaults to None.waterfall_positive_color (
Optional
[str
]) – The color of positive plots in the waterfall plot, defaults to None.waterfall_negative_color (
Optional
[str
]) – The color of negative plots in the waterfall plot, defaults to None.expected_title (
Optional
[str
]) – The expected title to show for the :class:`~predict_backend.page.elements.WaterfallPlot`s generated from this dashboard, defaults to “Expected Value”.predicted_title (
Optional
[str
]) – The predited title to show for the :class:`~predict_backend.page.elements.WaterfallPlot`s generated from this dashboard, defaults to “Final Prediction”.top_n (
Optional
[int
]) – Show only the top N values for the waterfall plot, defaults to None.train_data (
Optional
[Dataset
]) – Optionally pass in a separate trainingDataset
to use for the explainer, defaults to Noneencoding (
Optional
[DataEncoding
]) – The encoding of the categorical values in the dataset, Attempts to auto-determine if categorical variables are still found.color_by_category (
bool
) – Whether to color the scatterplot by category.show_title (
bool
) – Whether or not to show the title on the page when rendered, defaults to True.show_description (
bool
) – Whether or not to show the description to the page when rendered, defaults to True.
- save(link, is_ssf=False)#
Save the explainer persistence object.
- Parameters:
link (
Link
) – The link to save the element to.
- set_content(content)#
Validate and set content (python best practice is to set instance attributes in constructor).
- Parameters:
kwargs – new content for the Element.