shapley: Describes the difference between the expected value and the...

Description Usage Arguments Value

Description

Calculates the approximated shapley value for every feature for a chosen observation (row.nr). Supported tasks are reggression, multilabeling, clustering and classification tasks. The result contains a lot of information about the task type, feature names, predict type, prediction response, mean of the target variable(s) and the shapley values for every feature.

The implemented algorithm is taken from "Erik Strumbelj and Igor Kononenko. 2014. Explaining prediction models and individual predictions with feature contributions. Knowl. Inf. Syst. 41, 3 (December 2014), 647-665".

Usage

1
shapley(row.nr, task, model, iterations = 30)

Arguments

row.nr

Index for the observation of interest. It is possible to choose a range of rows. Input has to be a numeric.

task

Machine leraning task

model

Model for the corresponding task. Input has to be a wrapped model.

iterations

Amount of iterations within the shapley function. Input has to be a numeric.

Value

A shapley object as a list containing several information. Among others the shapley.values are returned as a data.frame with the features as columns and their corresponding effects.


redichh/ShapleyR documentation built on May 28, 2019, 7:49 a.m.