Learn R Programming

modelgrid (version 1.1.1.0)

share_settings: 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

Run this code
# NOT RUN {
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
      )
  )
# }

Run the code above in your browser using DataLab