write_config: Write an rtemis config to a JSON file

write_configR Documentation

Write an rtemis config to a JSON file

Description

Write a config object to a schema.rtemis.org JSON file that can be read back with read_config and consumed by rtemislive and the rtemis CLI. The emitted JSON carries a ⁠$schema⁠ field identifying the config family, so the reader can dispatch to the right object:

Usage

write_config(x, file, overwrite = FALSE, verbosity = 1L)

Arguments

x

A SuperConfig, DecomposeConfig, ClusterConfig, DecompositionConfig, ClusteringConfig, or PreprocessorConfig object.

file

Character: Path to output JSON file.

overwrite

Logical: If TRUE, overwrite an existing file.

verbosity

Integer: Verbosity level.

Details

  • SuperConfig (from setup_SuperConfig) -> supervised schema.

  • DecomposeConfig (from setup_DecomposeConfig) -> decompose schema.

  • ClusterConfig (from setup_ClusterConfig) -> cluster schema.

  • DecompositionConfig (from setup_PCA(), setup_ICA(), ...) -> decomposition schema.

  • ClusteringConfig (from setup_KMeans(), setup_DBSCAN(), ...) -> clustering schema.

  • PreprocessorConfig (from setup_Preprocessor) -> preprocessor schema.

A config is an input: what a run is being asked to do. Fields it omits fall back to their ⁠setup_*⁠ defaults when read, so a config stays valid as those defaults improve. That is the opposite of a record, which states what one run actually did, with every value resolved – see write_record. The two are separate functions, so a caller names the artifact they want.

Value

x, invisibly.

Author(s)

EDG

Examples

x <- setup_SuperConfig(
  dat_training_path = "~/Data/iris.csv",
  hyperparameters = setup_LightRF(),
  outer_resampling_config = setup_KFold(),
  question = "Can we tell iris species apart given their measurements?",
  outdir = "models/"
)
tmpfile <- file.path(tempdir(), "rtemis.json")
write_config(x, tmpfile, overwrite = TRUE)

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