Skip to contents

How the model's predicted probability moves as one predictor changes, with the others held at their observed values. Partial dependence averages over the data; accumulated local effects are more trustworthy when predictors are correlated, which on a casualty card they are.

Usage

sdt_profile(
  x,
  variables = NULL,
  type = c("partial", "accumulated"),
  data = NULL
)

Arguments

x

An sdt_model from sdt_fit(), or an explainer from sdt_explain().

variables

Predictors to profile. Defaults to all of them.

type

"partial" for a PDP, "accumulated" for ALE.

data

Optional data to explain on, passed to sdt_explain().

Value

A ggplot2 object.

Examples

# See ?sdt_importance for a runnable example.
sdt_engines()
#> # A tibble: 9 × 4
#>   engine      package class_box installed
#>   <chr>       <chr>   <chr>     <lgl>    
#> 1 tree        rpart   glass     TRUE     
#> 2 multinom    nnet    glass     TRUE     
#> 3 glmnet      glmnet  glass     TRUE     
#> 4 mars        earth   grey      TRUE     
#> 5 xgboost     xgboost grey      TRUE     
#> 6 ranger      ranger  black     TRUE     
#> 7 svm_rbf     kernlab black     TRUE     
#> 8 mlp         nnet    black     TRUE     
#> 9 transformer keras3  closed    TRUE