Perform linear or non-linear decomposition of numeric data.
Usage
decomp(
x,
algorithm = "ICA",
config = NULL,
execution_config = setup_FutureExecution(),
outdir = NULL,
verbosity = 1L
)Arguments
- x
Matrix, data frame, or
DecomposeConfigobject: Input data, or aDecomposeConfigrecipe (from setup_DecomposeConfig) carrying the data path, algorithm config, and output directory.- algorithm
Character: Decomposition algorithm. Not needed when
configis supplied, which names its own; an explicitalgorithmthat disagrees withconfigis an error.- config
DecompositionConfig: Algorithm-specific config. Its
featuresselects the columns ofxto decompose;NULLselects every numeric column, since a decomposition reads a numeric matrix. The returned object's config carries the resolved names, andapply_decomp()replays that selection.- execution_config
ExecutionConfigobject: Execution settings, e.g. setup_FutureExecution or setup_SerialExecution. A decomposition dispatches no work to other processes: an algorithm whosethreadedtrait is TRUE (see decomposition_traits) runs onn_workers_algorithmthreads, or on the config's worker count when that is unset. Itsdeviceis the compute device of an algorithm that can use one (setup_Autoencoder); every other algorithm runs on the CPU. The config'sseedseeds the fit, torch's generator included.- outdir
Character, optional: Output directory. If not NULL, the returned
Decompositionobject is saved there as an.rdsfile, alongside a run record (decomp_<algorithm>.record.json) stating what the run resolved. See write_record.- verbosity
Integer: Verbosity level.
Details
See docs.rtemis.org/r for detailed documentation.
Examples
iris_pca <- decomp(exc(iris, "Species"), algorithm = "PCA")#> 2026-10-20 09:07:41
#> ▶
#> [decomp]
#> 2026-10-20 09:07:41
#> Input: 150 cases x 4 features.
#> [summarize_unsupervised]
#> 2026-10-20 09:07:41
#> // CPU | future (mirai_multisession) | 7 workers: algorithm 1 thread
#> [msg_resources]
#> 2026-10-20 09:07:41
#> Decomposing with PCA...
#> [decomp]
#> 2026-10-20 09:07:41
#> Done in 2e-03 seconds.
#> [decomp]