Learn R Programming

rtemis (version 0.79)

gridSearchLearn: rtemis internal: Grid Search for Hyperparameter Tuning of rtemis Learners

Description

Train models using a combination of parameter values for model selection

Usage

gridSearchLearn(x, y, mod, grid.params, fixed.params = NULL,
  search.type = c("exhaustive", "randomized"),
  resample.rtset = rtset.resample(), randomized.p = 0.05,
  weights = NULL, error.aggregate.fn = mean, metric = NULL,
  maximize = NULL, save.mod = FALSE, verbose = TRUE,
  call.depth = 1, grid.verbose = FALSE, n.cores = rtCores, ...)

Arguments

x

features - training set. Will be resampled to multiple train-test sets

y

outcome - training set. Will be resampled to multiple train-test sets

mod

String: rtemis model. See modSelect() gives available models

grid.params

List of named elements, each is a vector of values

fixed.params

List of named elements, each is a single value (Classification will always maximize Accuracy)

search.type

String: "exhaustive" (Default), "randomized". Type of grid search to use. Exhaustive search will try all combinations of parameters. Randomized will try a random sample of size randomize.p * N of all combinations

resample.rtset

List: Output of rtset.grid.resample()

randomized.p

Float (0, 1): For search.type == "exhaustive", sample this portion of combination. Default = .05

weights

Float, vector: Case weights

error.aggregate.fn

Function: Use this when aggregating error metrics. Default = mean

metric

String: Metric to minimize or maximize

maximize

Logical: If TRUE, maximize metric

save.mod

Logical: If TRUE, save all trained models. Default = FALSE

verbose

Logical: If TRUE, print messages to screen

call.depth

Integer: passed to msg. Default = 2

grid.verbose

Logical: Passed to learner's verbose argument

n.cores

Integer: Number of cores to use

...

Additional arguments to be passed to resample

Details

Note that weights, if defined (and not NULL), should be passed directly to gridSearchLearn as they need to be resampled along x and y, and should not be passed along with grid.params. ipw and ipw.type should be passed as part of grid.params and will be passed on to the learner. Includes a special case for training s.H2OGBM or s.GBM which requires extracting and averaging n.trees along with params.