Learn R Programming

modelgrid (version 1.1.1.0)

consolidate_model: Consolidate model settings to a complete caret model specification

Description

Consolidate model (and model training) settings from shared and model specific settings to one complete caret model specification. In case there is an overlap between the two, the model specific settings will apply.

Usage

consolidate_model(shared_settings, model)

Arguments

shared_settings

list, settings that are shared by all models by default.

model

list, the individual specifications of a model in a model grid.

Value

list, a complete model and training specification, that can be trained with caret.

Examples

Run this code
# NOT RUN {
library(magrittr)
library(dplyr)
library(caret)

# create model grid.
mg <-
  model_grid() %>%
  share_settings(y = iris[["Species"]],
                 x = iris %>% select(-Species),
                 trControl = trainControl()) %>%
  add_model("FunkyForest", method = "rf",
            preProc = c("center", "scale", "pca"),
            custom_control = list(preProcOptions = list(thresh = 0.8)))

# consolidate all settings to complete caret model specification.
consolidate_model(mg$shared_settings, mg$models$FunkyForest)
# }

Run the code above in your browser using DataLab