getModelConf: Get model configuration

View source: R/getModelConf.R

getModelConfR Documentation

Get model configuration

Description

Configure machine and deep learning models

Usage

getModelConf(
  modelArgs = NULL,
  model,
  task.type = NULL,
  nFeatures = NULL,
  active = NULL
)

Arguments

modelArgs

list with information about model, active variables etc. Note: argList will replace the other arguments. Use argList$model instead of model etc.

model

machine or deep learning model (character). One of the following:

"cvglmnet"

glm net.

"kknn"

nearest neighbour.

"ranger"

random forest.

"rpart"

recursive partitioning and regression trees, rpart

"svm"

support vector machines.

"xgboost"

gradient boosting, xgb.train.

"dl"

deep learning: dense network.

"cnn"

deep learning: convolutionary network

.

task.type

character, either "classif" or "regr".

nFeatures

number of features, e.g., sum(task$task.desc$n.feat)

active

vector of activated tunepars, e.g., c("minsplit", "maxdepth") for model "rpart"

Value

Returns returns a list of the machine learning model configuration and corresponding hyperparameters:

learner

character: combination of task.type and model name.

lower

vector of lower bounds.

upper

vector of upper bounds.

fixpars

list of fixed parameters.

factorlevels

list of factor levels.

transformations

vector of transformations.

dummy

logical. Use dummy encoding, e.g., xgb.train

relpars

list of relative hyperparameters.

Examples

# Get hyperparameter names and their defaults for fitting a
# (recursive partitioning and  regression trees) model:
modelArgs <- list(model = "rpart")
cfg <- getModelConf(modelArgs)
cfg$tunepars
cfg$defaults
## do not use anymore:
cfg <- getModelConf(model="rpart")
cfg$tunepars
cfg$defaults
modelArgs <- list(model="rpart", active = c("minsplit", "maxdepth"))
cfgAct <- getModelConf(modelArgs)
cfgAct$tunepars
cfgAct$defaults


SPOTMisc documentation built on Sept. 5, 2022, 5:06 p.m.