surv_ceteris_paribus: Helper functions for 'predict_profile.R'

View source: R/surv_ceteris_paribus.R

surv_ceteris_paribusR Documentation

Helper functions for predict_profile.R

Description

Helper functions for predict_profile.R

Helper functions for predict_profile.R

Usage

surv_ceteris_paribus(x, ...)

## S3 method for class 'surv_explainer'
surv_ceteris_paribus(
  x,
  new_observation,
  variables = NULL,
  categorical_variables = NULL,
  variable_splits = NULL,
  grid_points = 101,
  variable_splits_type = "uniform",
  center = FALSE,
  output_type = "survival",
  ...
)

Arguments

x

an explainer object - model preprocessed by the explain() function

...

other parameters, currently ignored

new_observation

a new observation for which predictions need to be explained

variables

character, names of the variables to be included in the calculations

categorical_variables

character vector, names of variables that should be treated as categories (factors are included by default)

variable_splits

named list of splits for variables, in most cases created with internal functions. If NULL then it will be calculated based on validation data available in the explainer

grid_points

maximum number of points for profile calculations. Note that the final number of points may be lower than grid_points. Will be passed to internal function. By default 101.

variable_splits_type

character, decides how variable grids should be calculated. Use "quantiles" for percentiles or "uniform" (default) to get uniform grid of points.

Value

A data.frame containing the result of the calculation.


survex documentation built on Oct. 25, 2023, 1:06 a.m.