30  Configurations, records, and results

A configuration describes the requested analysis. A run record describes its resolved settings and execution. A portable result carries observed values such as outcomes, predictions, and metrics. An R fitted object additionally contains the backend state used for prediction.

30.1 Write a training configuration

data_path <- tempfile(fileext = ".csv")
write.csv(iris, data_path, row.names = FALSE)
config <- setup_SuperConfig(
  dat_training_path = data_path,
  outcome = "Species",
  hyperparameters = setup_CART(),
  outer_resampling_config = setup_KFold(n_resamples = 3L, seed = 2026L),
  execution_config = setup_SerialExecution(seed = 2027L),
  outdir = NULL
)
config_path <- tempfile(fileext = ".json")
write_config(config, config_path)
2026-10-08 02:54:41 ✔ Created file: /var/folders/cr/lgjpmnv97lg6qtnjt9kph7qw0000gn/T//Rtmp4HiWEK/filee49b72c3b674.json [write_lines]
restored_config <- read_config(config_path)
mod <- train(restored_config)
2026-10-08 02:54:41 ▶ Reading filee49b78316499.csv using data.table... [read]
2026-10-08 02:54:41 Read in 150 x 5 [read]
2026-10-08 02:54:41 Converting 1 character feature to a factor... [preprocess]
2026-10-08 02:54:41 Preprocessing done. [preprocess]
2026-10-08 02:54:41 Done in 0.04 seconds. [read]
2026-10-08 02:54:41 Checking data is ready for training... ✔ [check_supervised]
2026-10-08 02:54:41 ▶
2026-10-08 02:54:42 Training set: 150 cases x 4 features. [summarize_supervised]
2026-10-08 02:54:42 // CPU | serial | 1 worker: algorithm 1 thread, tuning 1, outer resampling 1 [msg_resources]
2026-10-08 02:54:42 Shared memory (auto): not sharing training data (8 kB) -- this run transfers nothing to workers. [report_shared_memory]
2026-10-08 02:54:42 <> Training CART Classification using 3 independent folds...

⠋ Outer resamples 1/3
⠙ Outer resamples 2/3 ETA 0:02
⠹ Outer resamples 3/3 ETA 0:01
⠸ Outer resamples 3/3         
                     
2026-10-08 02:54:44 ✔ Outer resamples 3/3 done in 0:01
2026-10-08 02:54:44 </> Outer resampling done.
<Resampled Classification Model>
CART (CART decision tree (rpart))
⟳ Tested using 3 independent folds.

  <Resampled Classification Training Metrics>
  Aggregate Confusion Matrix across resamples.
                     Predicted
          Reference  setosa  versicolor  virginica  
             setosa     100           0          0
         versicolor       0          98          2
          virginica       0           1         99

  Showing mean (sd) across resamples.
  Balanced Accuracy: 0.990 (0.010)
                 F1: 0.990 (0.010)
           Accuracy: 0.990 (0.010)

  <Resampled Classification Test Metrics>
  Aggregate Confusion Matrix across resamples.
                     Predicted
          Reference  setosa  versicolor  virginica  
             setosa      50           0          0
         versicolor       0          48          2
          virginica       0           5         45

  Showing mean (sd) across resamples.
  Balanced Accuracy: 0.953 (0.030)
                 F1: 0.953 (0.030)
           Accuracy: 0.953 (0.030)

2026-10-08 02:54:44 Done in 2.54 seconds.

Path configurations store the supplied paths. Deployment and working-directory conventions determine where relative paths resolve. setup_DecomposeConfig() and setup_ClusterConfig() provide corresponding pipeline configurations.

30.2 Portable validation

Published JSON Schemas describe document structure, types, bounds, and applicability. Separate defaults artifacts describe declaration defaults and input-resolution policies. An omitted property and an explicit JSON null have distinct meanings under those policies.

A complete reader validates authored input, resolves applicable defaults, validates the resolved document, and evaluates the published semantic rules. Checks requiring data or a runtime context remain pending until that context is available. read_config() reconstructs typed R configurations; validate_config() adds structured configuration and data findings.

Implementation-specific configurations identify their schema. A shared result can therefore carry settings belonging to a particular language implementation. Schema compatibility does not imply identical numerical behavior across implementations.

30.3 Record a run

run_record <- record(mod)
record_path <- tempfile(fileext = ".record.json")
write_record(mod, record_path)
2026-10-08 02:54:44 ✔ Created file: /var/folders/cr/lgjpmnv97lg6qtnjt9kph7qw0000gn/T//Rtmp4HiWEK/filee49ba1f0ff4.session.parquet [write_session_sidecar]
2026-10-08 02:54:44 ✔ Created file: /var/folders/cr/lgjpmnv97lg6qtnjt9kph7qw0000gn/T//Rtmp4HiWEK/filee49ba1f0ff4.record.json [write_lines]

Records include resolved values and origins, provenance, data fingerprints, fold-level information, and metrics. Session graphs can use Parquet sidecars. outdir on train(), decomp(), or cluster() writes the fitted R object and a run record. read_config() accepts input configurations; a run record has a separate contract.

30.4 Export observed results

result_dir <- tempfile("result-")
dir.create(result_dir)
result_path <- file.path(result_dir, "result.json")
write_result(mod, result_path, storage = "inline")

storage = "auto" chooses inline or Parquet storage by payload size; storage = "parquet" externalizes eligible arrays. Sidecar references carry integrity and shape information. Move the result JSON together with its referenced files.

Reading requires a local schema registry containing the relevant versioned schemas and defaults/v1/defaults.json. With that registry available:

result <- read_result("result.json", registry = "schema-registry")
materialized <- read_result(
  "result.json", registry = "schema-registry", load_data = TRUE
)

The first call retains lazy references. The second verifies and loads their payloads. Portable results preserve observed data and metadata; native fitted backend objects require the R model artifact for subsequent prediction.

© 2026 E.D. Gennatas