Fit and evaluate one XGBoost model for a single perturbation.
Usage
make_xgb_model(
perturbation,
indx,
total,
dataset,
response_cutoff = 0.5,
decreasing = FALSE,
nfolds = 3,
nrepeats = 3,
nrounds = 200,
max_depth = 3,
f_subsample = 1,
min_score = 0.01,
shuffle = FALSE,
seed = 1L,
n_threads = 4,
xgb_params = NULL,
cor_n_features = NULL,
shap_top_n = 100L
)Arguments
- perturbation
Column name of the perturbation to model.
- indx
Integer model index used for progress reporting.
- total
Total number of models used for progress reporting.
- dataset
Data frame containing the perturbation response and predictor columns. Sample names are row names.
- response_cutoff
Default biological response cutoff used to define target events for classification-style summaries and downstream event probabilities.
- decreasing
If TRUE, values at or below
response_cutoffdefine the target event; otherwise values at or above the cutoff define the target event.- nfolds
Number of cross-validation folds.
- nrepeats
Number of repeated cross-validation runs.
- nrounds
Maximum number of XGBoost boosting rounds.
- max_depth
Maximum tree depth.
- f_subsample
Fraction of training rows sampled for each boosting round.
- min_score
Minimum mean R-squared required to retain the fitted model.
- shuffle
If TRUE, shuffle response values before model fitting.
- seed
Base random seed. A deterministic perturbation-specific seed is derived from this value so model results do not depend on target order. Both values are stored in each returned model object as
seedandtarget_seed.- n_threads
Number of threads passed to XGBoost.
- xgb_params
Optional named list overriding supported XGBoost parameters.
- cor_n_features
Optional number of target-correlated features to retain. When set, features are ranked by absolute correlation within each cross-validation training fold and reranked using all training samples for the final refit.
NULLdisables correlation filtering.- shap_top_n
Maximum number of non-intercept SHAP features retained per sample before remaining contributions are collapsed into
__other__.