View source: R/make_xgb_models.R
fit_models_and_save | R Documentation |
This function creates an XGBoost model for each perturbation given, saves the list of models, and returns a message.
fit_models_and_save(
perturbs,
chunk_indx,
model_dataset,
response_cutoff = 0.5,
weight_cap = 0,
nfolds = 3,
nrepeats = 1,
nrounds = 200,
min_score = 0.5,
max_depth = 3,
f_subsample = 1,
skip_eval = FALSE,
shuffle = FALSE,
xgb_params = NULL,
n_threads = 4,
use_gpu = TRUE,
gpu_id = 0,
seed = 123,
path = NULL
)
perturbs |
A vector of perturbations. |
chunk_indx |
Integer index used, for progress report. |
model_dataset |
A dataframe with the perturbation in a column and all other predictors. Sample names are row names. |
response_cutoff |
The value above which the sample is considered sensitive. |
weight_cap |
The maximum weight of each minority case when resampling. Set to 0 if no resampling needed. |
nfolds |
The number of folds in k-fold cross validation. |
nrepeats |
The number of repeats in k-fold cross validation. |
nrounds |
The maximum number of trees in the XGBoost model. |
min_score |
The minimum number of r^2 value for a model to be considered for the next stage (making predictions and calculating SHAP values). |
skip_eval |
Default = FALSE. If TRUE, k-fold CV will not be conducted and instead all models will be pushed to the next stage. |
use_gpu |
Default = TRUE. Set to FALSE if using CPU. |
seed |
Random seed |
path |
Folder path (e.g. "/home/test/models") to save models in. |
fit_models_and_save(my_data, c("ko_ctnnb1","ko_myod1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.