Description Usage Arguments Value
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".
1 | shapley(row.nr, task, model, iterations = 30)
|
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. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.