model_functions {cvms}R Documentation

Examples of model_fn functions

Description

[Experimental]

Examples of model functions that can be used in cross_validate_fn(). They can either be used directly or be starting points.

The update_hyperparameters() function updates the list of hyperparameters with default values for missing hyperparameters. You can also specify required hyperparameters.

Usage

model_functions(name)

Arguments

name

Name of model to get model function for, as it appears in the following list:

Name Function Hyperparameters (default)
"lm" stats::lm()
"lmer" lme4::lmer() REML (FALSE)
"glm_binomial" stats::glm()
"glmer_binomial" lme4::glmer()
"svm_gaussian" e1071::svm() kernel ("radial"), cost (1)
"svm_binomial" e1071::svm() kernel ("radial"), cost (1)
"svm_multinomial" e1071::svm() kernel ("radial"), cost (1)
"naive_bayes" e1071::naiveBayes() laplace (0)

Value

A function with the following form:

function(train_data, formula, hyperparameters) {

⁠ ⁠# Return fitted model object

}

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

Other example functions: predict_functions(), preprocess_functions(), update_hyperparameters()


[Package cvms version 1.6.1 Index]