Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pdp_predictions

get predictions compatible with the partial dependence plotting method, parallel variant is called by get_pdp_predictions()


Description

get predictions compatible with the partial dependence plotting method, parallel variant is called by get_pdp_predictions()

Usage

pdp_predictions(
  df,
  imp,
  m,
  degree = 4,
  bins = 5,
  .f_predict = predict,
  parallel = FALSE
)

Arguments

df

dataframe, training data

imp

dataframe, with not more then two columns one of them numeric containing importance measures and one character or factor column containing corresponding variable names as found in training data.

m

model object

degree

integer, number of top important variables to select. For plotting more than 4 will result in two many flows and the alluvial plot will not be very readable, Default: 4

bins

integer, number of bins for numeric variables, increasing this number might result in too many flows, Default: 5

.f_predict

corresponding model predict() function. Needs to accept 'm' as the first parameter and use the 'newdata' parameter. Supply a wrapper for predict functions with x-y syntax. For parallel processing the predict method of object classes will not always get imported correctly to the worker environment. We can pass the correct predict method via this parameter for example randomForest:::predict.randomForest. Note that a lot of modeling packages do not export the predict method explicitly and it can only be found using :::.

parallel

logical, Default: TRUE

See Also


easyalluvial

Generate Alluvial Plots with a Single Line of Code

v0.3.0
CC0
Authors
Bjoern Koneswarakantha [aut, cre] (<https://orcid.org/0000-0003-4585-7799>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.