interpret_community.widget package

Module for Explanation Dashboard widget.

class interpret_community.widget.ExplanationDashboard(explanation, model=None, *, dataset=None, true_y=None, classes=None, features=None, port=None, datasetX=None, trueY=None, locale=None, public_ip=None, with_credentials=False, use_cdn=None)

Bases: object

Explanation Dashboard Class.

Parameters:
  • explanation (ExplanationMixin) – An object that represents an explanation.
  • model (object) – An object that represents a model. It is assumed that for the classification case it has a method of predict_proba() returning the prediction probabilities for each class and for the regression case a method of predict() returning the prediction value.
  • dataset (numpy.array or list[][]) – A matrix of feature vector examples (# examples x # features), the same samples used to build the explanation. Overwrites any existing dataset on the explanation object. Must have fewer than 10000 rows and fewer than 1000 columns.
  • datasetX (numpy.array or list[][]) – Alias of the dataset parameter. If dataset is passed, this will have no effect. Must have fewer than 10000 rows and fewer than 1000 columns.
  • true_y (numpy.array or list[]) – The true labels for the provided dataset. Overwrites any existing dataset on the explanation object.
  • classes (numpy.array or list[]) – The class names.
  • features (numpy.array or list[]) – Feature names.
  • port (int) – The port to use on locally hosted service.
  • use_cdn (bool) –

    Deprecated. Whether to load latest dashboard script from cdn, fall back to local script if False. .. deprecated:: 0.15.2

    Deprecated since 0.15.2, cdn has been removed. Setting parameter to True or False will trigger warning.
  • public_ip (str) – Optional. If running on a remote vm, the external public ip address of the VM.
  • with_credentials (bool) – Optional. If running on a remote vm, sets up CORS policy both on client and server.
class DashboardService(port, public_ip, with_credentials=False)

Bases: object

get_base_url()
run()
default_template = <Template 'inlineDashboard.html'>
env = <jinja2.environment.Environment object>
explanations = {}
model_count = 0
service = None