## Loading required package: ggplot2
## Loading required package: lattice
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ lubridate 1.9.2 ✔ tibble 3.2.1
## ✔ purrr 1.0.2 ✔ tidyr 1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ✖ purrr::lift() masks caret::lift()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
##
## Attaching package: 'xgboost'
##
##
## The following object is masked from 'package:dplyr':
##
## slice
##
##
## randomForest 4.7-1.1
##
## Type rfNews() to see new features/changes/bug fixes.
##
##
## Attaching package: 'randomForest'
##
##
## The following object is masked from 'package:dplyr':
##
## combine
##
##
## The following object is masked from 'package:ggplot2':
##
## margin
##
##
## Loading required package: Matrix
##
##
## Attaching package: 'Matrix'
##
##
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
##
##
## Loaded glmnet 4.1-8
##
##
## Attaching package: 'ranger'
##
##
## The following object is masked from 'package:randomForest':
##
## importance
This is the grid we will search over. The values were chosen after careful consideration
learning_rates <- c(0.01, 0.1, 0.3, 0.5)
max_depth <- seq(4, 12)
gamma <- c(0.0, 0.5, 1.0, 0.3)
set.seed(5003)
models = c("gabexgb")
missing_value_methods = c(missing_value_none)
balance_methods = c(balance_method_1)
feature_selection_method = no_feature_selection
data_use <- data %>% select(-X, -SaO2, -heart_rhythm) %>% one_hot_encode_all_caret()
results = list()
for (model in models)
for (balance_method in balance_methods)
for (missing_value_method in missing_value_methods){
result <- evaluate_model(data_use, model_type = model, missing_method = missing_value_method,
feature_selection_method = no_feature_selection,
balance_method = balance_method)
results = append(results, result)
}
results$best_params
## [[1]]
## [1] "objective : binary:logistic | metric : error | learning_rate : 0.5 | max_depth : 12 | gamma : 0.3"