fit_predict_shap.Rd
Fit a linear model and compute SHAP values with response centering
fit_predict_shap(
X,
y,
newx,
model_type = "lm",
center_response = TRUE,
account_correlations = FALSE,
n_samples = 100,
lambda = 0.01,
tau = 0.5,
alpha = 1
)
Training feature matrix or data frame
Training response vector
New feature matrix or data frame for prediction/explanation
Type of model: "lm", "rlm", "rq", "glmnet"
Whether to center the response variable
Whether to use correlation-aware SHAP
Number of samples for correlation-aware computation
Regularization parameter for glmnet
Quantile for quantile regression
Elastic net mixing parameter for glmnet
List with model, predictions, SHAP values, and validation results