Skip to contents

This function generates a list which is compatible to be used as the method argument to train. This enables users to call train directly themselves with smooth_data smoothing functions.

Usage

makemethod_train_smooth_data(sm_method, tuneGrid = NULL)

Arguments

sm_method

Argument specifying which smoothing method should be used. Options include "moving-average", "moving-median", "loess", "gam", and "smooth.spline".

tuneGrid

A data frame with possible tuning value. The columns should be named the same as the tuning parameters.

Note that, when using train, the tuneGrid must be passed both to this function as well as directly to train.

Value

A list that can be used as the method argument to train. Contains elements: library, type, prob, fit, parameters, grid, fit, and predict.

See documentation on using a custom model model in train for more details.