Learn R Programming

ingredients (version 2.3.0)

calculate_variable_profile: Internal Function for Individual Variable Profiles

Description

This function calculates individual variable profiles (ceteris paribus profiles), i.e. series of predictions from a model calculated for observations with altered single coordinate.

Usage

calculate_variable_profile(
  data,
  variable_splits,
  model,
  predict_function = predict,
  ...
)

# S3 method for default calculate_variable_profile( data, variable_splits, model, predict_function = predict, ... )

Value

a data frame with profiles for selected variables and selected observations

Arguments

data

set of observations. Profile will be calculated for every observation (every row)

variable_splits

named list of vectors. Elements of the list are vectors with points in which profiles should be calculated. See an example for more details.

model

a model that will be passed to the predict_function

predict_function

function that takes data and model and returns numeric predictions. Note that the ... arguments will be passed to this function.

...

other parameters that will be passed to the predict_function

Details

Note that calculate_variable_profile function is S3 generic. If you want to work on non standard data sources (like H2O ddf, external databases) you should overload it.

References

Explanatory Model Analysis. Explore, Explain, and Examine Predictive Models. https://ema.drwhy.ai/