View source: R/make_xgb_models.R
| make_xgb_model | R Documentation | 
This function creates an XGBoost model
make_xgb_model(
  perturbation,
  indx,
  total,
  dataset,
  response_cutoff = 0.75,
  weight_cap = 0.05,
  nfolds = 3,
  nrepeats = 3,
  nrounds = 100,
  max_depth = 3,
  f_subsample = 1,
  min_score = 0.5,
  skip_eval = FALSE,
  shuffle = FALSE,
  n_threads = 4,
  xgb_params = NULL,
  use_gpu = TRUE,
  gpu_id = 0
)
| perturbation | Column name of the perturbation (e.g. "ko_ctnnb1"). | 
| indx | Integer index used, for progress report. | 
| total | Integer of the total number of perturbations passed to this function, for progress report. | 
| 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 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. | 
make_xgb_model("ko_ctnnb1",1,1,my_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.