| SHAPBoostSurvival-class | R Documentation |
This class extends the SHAPBoostEstimator class and implements methods for initializing, updating weights, scoring, and fitting estimators.
evaluatorThe model that is used to evaluate each additional feature. Choice between "coxph" and "xgb".
metricThe metric used for evaluation, such as "mae", "mse", or "r2".
xgb_paramsA list of parameters for the XGBoost model.
number_of_foldsThe number of folds for cross-validation.
epsilonA small value to prevent division by zero.
max_number_of_featuresThe maximum number of features to consider.
siso_ranking_sizeThe size of the SISO ranking.
siso_orderThe order of the SISO ranking.
resetA boolean indicating whether to reset the model.
xgb_importanceThe importance type for XGBoost.
num_resetsThe number of resets for the model.
fold_random_stateThe random state for folds.
verboseThe verbosity level for logging.
stratificationA boolean indicating whether to use stratification. Only applicable for c-index metric.
use_shapA boolean indicating whether to use SHAP values.
collinearity_checkA boolean indicating whether to check for collinearity.
correlation_thresholdThe threshold for correlation to consider features as collinear.
if (requireNamespace("survival", quietly = TRUE)) {
shapboost <- SHAPBoostSurvival$new(
max_number_of_features = 1,
evaluator = "coxph",
metric = "c-index",
verbose = 0,
xgb_params = list(
objective = "survival:cox",
eval_metric = "cox-nloglik"
)
)
X <- as.data.frame(survival::gbsg[, -c(1, 10, 11)])
y <- as.data.frame(survival::gbsg[, c(10, 11)])
subset <- shapboost$fit(X, y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.