Learn R Programming

multivarious (version 0.3.1)

fit: Fit a preprocessing pipeline

Description

Learn preprocessing parameters from training data. This function fits the preprocessing pipeline to the provided data matrix, learning parameters such as means, standard deviations, or other transformation parameters.

Usage

fit(object, X, ...)

Value

A fitted preprocessing object that can be used with transform() and inverse_transform()

Arguments

object

A preprocessing object (e.g., prepper or pre_processor)

X

A matrix or data frame to fit the preprocessing pipeline to

...

Additional arguments passed to methods

See Also

fit_transform(), transform(), inverse_transform()

Examples

Run this code
# Fit a centering preprocessor
X <- matrix(rnorm(100), 10, 10)
preproc <- center()
fitted_preproc <- fit(preproc, X)

# Transform new data
X_new <- matrix(rnorm(50), 5, 10)
X_transformed <- transform(fitted_preproc, X_new)

Run the code above in your browser using DataLab