xai_dashboard

class virtualitics_sdk.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 and Dataset 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 training Dataset to use for the explainer, defaults to None

  • encoding (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 to show the title on the page when rendered, defaults to True.

  • show_description (bool) – whether to show the description to the page when rendered, defaults to True.

get_value()

Get the value of an element. If the user has interacted with the value, the default will be updated.

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.

set_params(params)

Validate and set params (python best practice is to set instance attributes in constructor).

Parameters:

kwargs – new params for the Element.

update_from_user_input(user_input)

Updates the element default values from user input.

Parameters:

user_input – Input from a user on the platform.

static xai_dashboard_description()