Learn R Programming

rtemis (version 1.4.3)

get_fitted_config: 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 used. One merge, so the two cannot disagree.

Usage

get_fitted_config(preprocessor)

Value

PreprocessorConfig with the learned values applied.

Arguments

preprocessor

Preprocessor object.

Author

EDG

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.

See Also

apply_preprocessor, setup_Preprocessor

Examples

Run this code
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.
get_fitted_config(iris_pre)@scale_centers

Run the code above in your browser using DataLab