do_fit: Fit model

Description Usage

View source: R/do_fit.R

Description

Tune and fit model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
do_fit(
  data = NULL,
  x = NULL,
  y = NULL,
  col_y = NULL,
  id = NULL,
  col_id = NULL,
  overwrite = TRUE,
  export = TRUE,
  minimal = FALSE,
  f_import = readr::read_rds,
  f_export = readr::write_rds,
  ...,
  drop = TRUE,
  dir = .get_dir_data(),
  file = NULL,
  ext = "rds",
  sep = "_",
  suffix = NULL,
  seed = .get_seed(),
  .do = list(tune = NULL, fit = NULL),
  .f_import = list(tune = NULL, fit = if (minimal) {     xgboost::xgb.load } else {    
    NULL }),
  .f_export = list(tune = NULL, fit = if (minimal) {     xgboost::xgb.save } else {    
    NULL }),
  .export = list(tune = NULL, fit = NULL),
  .overwrite = list(tune = NULL, fit = NULL),
  .dir = list(tune = NULL, fit = NULL),
  .file = list(tune = "tune", fit = "fit"),
  .ext = list(tune = NULL, fit = if (minimal) {     "model" } else {     NULL }),
  .path = list(tune = NULL, fit = NULL),
  print_every_n = 10,
  fold_ids = NULL,
  n_fold = 10,
  strata = NULL,
  col_strata = NULL,
  wt = NULL,
  col_wt = NULL,
  cols_extra = NULL,
  grid_params = NULL,
  n_param = 10,
  nrounds = 2000,
  booster = "gbtree",
  objective = "reg:squarederror",
  eval_metrics = list("rmse"),
  .params_tune = list(NULL),
  .params = list(NULL),
  f_slice = dplyr::slice_min,
  early_stopping_rounds = 10
)

tonyelhabr/xgbh documentation built on Dec. 23, 2021, 11:59 a.m.