fitted_config: A 'Preprocessor"s config with its learned values filled in

View source: R/preprocess.R

fitted_configR Documentation

A Preprocessor's config with its learned values filled in

Description

⁠@config⁠ holds what the user asked for and ⁠@values⁠ what preprocessing learned, which keeps the input intact – but re-applying to new data needs the two merged, and so does a run record, which must report the values actually used. One merge, so the two cannot disagree.

Usage

fitted_config(preprocessor)

Arguments

preprocessor

Preprocessor object.

Details

The merged fields are settable inputs: supplying scale_centers makes preprocess() use it instead of computing one. That is why the merge is ⁠@values⁠ over ⁠@config⁠ and not the reverse – a learned value only fills a slot the user left empty.

Value

PreprocessorConfig with the learned values applied.

Author(s)

EDG

See Also

apply_preprocessor, setup_Preprocessor

Examples

iris_pre <- preprocess(iris, setup_Preprocessor(scale = TRUE, center = TRUE))
# The config as supplied carries no centers; the fitted one carries the
# centers `preprocess()` computed.
fitted_config(iris_pre)@scale_centers

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.