prep: Class for preprocessing object

View source: R/prep.R

prepR Documentation

Class for preprocessing object

Description

Class for preprocessing object

Usage

prep(name, params = NULL, method = NULL)

Arguments

name

short text with name for the preprocessing method.

params

a list with parameters for the method (if NULL - default parameters will be used).

method

method to call when applying the preprocessing, provide it only for user defined methods.

Details

Use this class to create a list with a sequence of preprocessing methods to keep them together in right order and with defined parameters. The list/object can be provided as an extra argument to any modelling function (e.g. pca, pls, etc), so the optimal model parameters and the optimal preprocessing will be stored together and can be applied to a raw data by using method predict.

For your own preprocessing method you need to create a function, which takes matrix with values (dataset) as the first argument, does something and then return a matrix with the same dimension and same attributes as the result. The method can have any number of optional parameters.

See Bookdown tutorial for details.


mdatools documentation built on Sept. 11, 2024, 7:59 p.m.