valueFunction: Value Functions

Description Usage Arguments Format

Description

You can write your own value function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
calculateValueFunctionImportance(
  features,
  object,
  data,
  target = NULL,
  n.feat.perm = 50,
  measures,
  predict.fun = NULL,
  local = FALSE
)

calculateValueFunctionPerformance(
  features,
  object,
  data,
  target = NULL,
  n.feat.perm = 50,
  measures,
  predict.fun = NULL,
  local = FALSE
)

Arguments

features

[character]
The feature(s) for which the shapley importance should be computed.

object

[any]
Either a WrappedModel or a ResampleResult. You can also provide any other trained model (however, this is experimental and you need to provide an appropriate predict.fun).

data

[data.frame]
The data whose features will be permuted in order to measure their importance. If object is of class ResampleResult, you should use the corresponding data on which the whole resampling was performed. In any other case, you might use some independent test data that was not used to fit the model (although you could also use the train data here).

target

[character(1)]
Only needed if object is not of class WrappedModel or ResampleResult. Name of the target feature to be predicted.

n.feat.perm

[numeric(1)]
The number of permutations of the feature(s) used to compute the feature importance. The default is 50. If set to NULL, the cartesian product is used.

measures

[Measure | list of Measure | function | list of function]
Performance measure(s) used to measure the model performance. Can also be a named list of function with signature function(y, pred), where y and pred are vectors containing the true and the predicted values of the target.

predict.fun

[function]
Only needed if object is not of class WrappedModel or ResampleResult. The signature must be function(object, newdata) and the function should always return a vector of predictions. The default NULL internally uses predict(object, newdata = newdata).

local

[logical(1)]
Should the performance (or the feature importance) be computed observation-wise? Note that not all measures support this (e.g. one can not compute the AUC for one observation). The default is FALSE.

Format

none

none


giuseppec/featureImportance documentation built on June 1, 2021, 11:04 a.m.