The ceteris_paribus() function computes the predictions for the neighbor of our chosen observation. The neighbour is defined as the observations with changed value of one of the variable.

ceteris_paribus(explainer, observation, grid_points = 5,
selected_variables = NULL)

## Arguments

explainer a model to be explained, preprocessed by the 'survxai::explain' function a new observation for which predictions need to be explained grid_points number of points used for response path if specified, then only these variables will be explained

## Value

An object of the class surv_ceteris_paribus_explainer. It's a data frame with calculated average responses.

## Examples

library(survxai)
prob <- rms::survest(model, data, times = times)$surv return(prob) } cph_model <- cph(Surv(years, status)~., data = pbcTrain, surv = TRUE, x = TRUE, y=TRUE) surve_cph <- explain(model = cph_model, data = pbcTest[,-c(1,5)], y = Surv(pbcTest$years, pbcTest\$status),
cp_cph <- ceteris_paribus(surve_cph, pbcTest[1,-c(1,5)])