local_explanation: Get a local explanation for a chosen misclassified instance

Description Usage Arguments Value

View source: R/local_explanation.R

Description

Get a local explanation for a chosen misclassified instance

Usage

1
2
local_explanation(instance, egalitarian, method = "breakDown",
  predict_function = predict, ...)

Arguments

instance

observation to be explained as an index from 'validation_set'

egalitarian

object of class egalitarian

method

character specifying type of local explanation. Available options are "lime" for LIME, "live" for live and "breakDown" for breakDown. For details see documentations of packages lime, live and breakDown

predict_function

predict function for the model that returns classes, defaults to 'predict'

...

Additional parameters that will be passed to 'lime::explain', 'live::sample_locally2' or 'breakDown::broken'. For "live" method, this must include 'size' argument. If "lime" is used, model_type must be set. For details, read documentation for these packages. 'egalitarian' uses wrappers around these packages called 'lime_extractor', 'live_extractor' and 'breakDown'. More information can be found in help for these functions

Value

object of class egalitarian_local_explanation that consists of

data

data from 'egalitarian' object

target_name

name of response variable

model

model object from 'egalitarian' object

instance

index of explained instance in validation set

explanation_type

character name indicating which explainer was used

local_explanation

explanation object created by lime/live/breakDown package

variables

names of variables which influenced the prediction negatively


mstaniak/egalitaRian documentation built on Aug. 26, 2019, 11:11 p.m.