tune_xgboost: Train and test XGBoost classifier.

Description Usage Arguments Value Examples

View source: R/modeling.R

Description

Train and test XGBoost classifier.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tune_xgboost(
  training_data,
  testing_data,
  save_model = TRUE,
  model_name = paste0("opioid_xgboost_model_", Sys.Date()),
  target = "opioid",
  features = "defaults",
  cv_iters = 5,
  tune_iters = 50
)

Arguments

training_data

formatted EMS data for model training

testing_data

formatted EMS data for model training

save_model

Logical flag to save model as .RDS object

model_name

Filepath and name of model to save, .RDS extension not needed

target

Binary (0/1) for class labels

features

Character vector of features, "default" for recommended options

cv_iters

Number of cross validation folds for use in tuning - must be greater than 1

tune_iters

Number of overall tuning iterations - must be greater than 1

Value

List object with model and test data with predictions

Examples

1
## Not run: tune_xgboost(training_data = train, testing_data = test)

anpatton/overdoseR documentation built on July 16, 2020, 1:53 a.m.