model_functions function

Examples of model_fn functions

Examples of model_fn functions

lifecycle::badge("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.

model_functions(name)

Arguments

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

    NameFunctionHyperparameters (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)

Returns

A function with the following form:

function(train_data, formula, hyperparameters) {

``# Return fitted model object

}

See Also

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

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

  • Maintainer: Ludvig Renbo Olsen
  • License: MIT + file LICENSE
  • Last published: 2025-03-07