Learn R Programming

SHAPBoost (version 1.0.3)

SHAPBoostRegressor-class: SHAPBoostRegressor is a reference class for regression feature selection through gradient boosting.

Description

This class extends the SHAPBoostEstimator class and implements methods for initializing, updating weights, scoring, and fitting estimators.

Arguments

Fields

evaluator

The model that is used to evaluate each additional feature. Choice between "lr" and "xgb".

metric

The metric used for evaluation, such as "mae", "mse", or "r2".

xgb_params

A list of parameters for the XGBoost model.

number_of_folds

The number of folds for cross-validation.

epsilon

A small value to prevent division by zero.

max_number_of_features

The maximum number of features to consider.

siso_ranking_size

The size of the SISO ranking.

siso_order

The order of the SISO ranking.

reset

A boolean indicating whether to reset the model.

xgb_importance

The importance type for XGBoost.

num_resets

The number of resets for the model.

fold_random_state

The random state for folds.

verbose

The verbosity level for logging.

stratification

A boolean indicating whether to use stratification. Only applicable for c-index metric.

use_shap

A boolean indicating whether to use SHAP values.

collinearity_check

A boolean indicating whether to check for collinearity.

correlation_threshold

The threshold for correlation to consider features as collinear.

Examples

Run this code
if (requireNamespace("flare", quietly = TRUE)) {
  data("eyedata", package = "flare")
  shapboost <- SHAPBoostRegressor$new(
    max_number_of_features = 1,
    evaluator = "lr",
    metric = "mae",
    siso_ranking_size = 10,
    verbose = 0
  )
  X <- as.data.frame(x)
  y <- as.data.frame(y)
  subset <- shapboost$fit(X, y)
}

Run the code above in your browser using DataLab