share_settings {modelgrid}R Documentation

Set shared settings of a model grid

Description

Set shared settings for all model (and training) configurations within a model grid. These settings will apply for any given model, unless the same settings have already been specified in the model specific configurations. In that case, the model specific settings will apply.

Usage

share_settings(model_grid, ...)

Arguments

model_grid

model_grid

...

All optional shared settings.

Value

model_grid equipped with shared settings.

Examples

library(magrittr)
library(caret)
library(dplyr)
data(GermanCredit)

# Pre-allocate empty model grid.
models <- model_grid()

# Set shared settings of model grid.
models %>%
  share_settings(
    y = GermanCredit[["Class"]],
    x = GermanCredit %>% select(-Class),
    metric = "ROC",
    preProc = c("center", "scale", "pca"),
    trControl = trainControl(
      method = "cv",
      number = 5,
      summaryFunction = twoClassSummary,
      classProbs = TRUE
      )
  )

[Package modelgrid version 1.2.0 Index]