Deborah.Sarah
Deborah.Sarah — Modulemodule SarahDeborah.Sarah — Common utilities for configuration, logging, resampling, I/O, and naming.
Deborah.Sarah is the utility toolkit shared across the Deborah.jl ecosystem. It offers job-aware logging, TOML helpers, string/name encoding, deterministic seeding, dataset partitioning and meta extraction, data loading, bootstrap/jackknife resampling, and summary formatting/collection. These utilities keep the higher-level modules small, consistent, and reproducible.
Scope & Responsibilities
- Logging & diagnostics: structured println/warn, timing, and job-scoped messages (
Deborah.Sarah.JobLoggerTools). TOMLhelpers: append well-formed sections to existingTOMLfiles (TOMLLogger.append_section_to_toml).- Naming & encoding: derive stable names/paths (
Deborah.Sarah.NameParser) and map long tokens $\Leftrightarrow$ abbreviations/IDs (Deborah.Sarah.StringTranscoder). - Seeding: centralized RNG seeding mainly used by bootstrap resampling for reproducible runs (
Deborah.Sarah.SeedManager). - Dataset partitioning: compute
LB/TR/BC/ULsplits and index ranges (Deborah.Sarah.DatasetPartitioner). XYmetadata & extraction: read columns, reshape per-(conf,src), and derive configuration indices (XYInfoGenerator.gen_conf_from_Y,XYInfoGenerator.gen_X_info).- Data loading: robust delimited-file loaders with fallbacks (
Deborah.Sarah.DataLoader). - Resampling: bootstrap and jackknife engines plus runners/utilities (
Deborah.Sarah.Bootstrap,Deborah.Sarah.Jackknife,Deborah.Sarah.BootstrapRunner). - Summaries: pretty
(avg, err)formatting and printing; accumulate per-observable summaries (Deborah.Sarah.SummaryFormatter,Deborah.Sarah.SummaryCollector).
Key Components (selected)
Deborah.Sarah.JobLoggerTools— job-scoped logging and convenience printers.TOMLLogger.append_section_to_toml— append a new[section]to aTOMLfile.Deborah.Sarah.StringTranscoder— encode/decode feature/target names, abbreviation dicts.Deborah.Sarah.NameParser— build canonicaloverall_name, model suffixes, and path pieces.Deborah.Sarah.SeedManager— set/get seeds for RNG workflows.Deborah.Sarah.DatasetPartitioner— compute label/train/bias-correction/unlabeled indices.XYInfoGenerator.gen_conf_from_Y— pick per-config IDs from aYmatrix (or1:N_cnf).XYInfoGenerator.gen_X_info— extract a single component column into(channels, N_cnf, N_src).Deborah.Sarah.Bootstrap,Deborah.Sarah.Jackknife— resampling cores;Deborah.Sarah.BootstrapRunnerorchestrates block bootstrap schemes.SummaryFormatter.print_bootstrap_average_error— compute & printAVG(ERR).SummaryFormatter.print_jackknife_average_error— from JK samples.SummaryFormatter.print_jackknife_average_error_from_raw— from raw data + bin size.Deborah.Sarah.SummaryCollector— gather per-module summaries into dicts for downstream printers.
Minimal Usage (REPL)
julia> using Deborah
# Append metadata to an existing TOML
julia> using Deborah.Sarah.TOMLLogger, OrderedCollections
julia> TOMLLogger.append_section_to_toml("config.toml", "metadata", OrderedCollections.OrderedDict("creator"=>"alice","notes"=>"test")) # appends a [metadata] section
# Extract configuration IDs and X info from raw matrices
julia> using Deborah.Sarah.XYInfoGenerator
julia> conf = XYInfoGenerator.gen_conf_from_Y(Y, N_cnf, N_src, 3) # read conf IDs from 3rd column
julia> X_info = XYInfoGenerator.gen_X_info(X, N_cnf, N_src, 1) # take column 1 as the component
# Print bootstrap and jackknife summaries
julia> using Deborah.Sarah.SummaryFormatter
julia> SummaryFormatter.print_bootstrap_average_error(bs_arr, "Y_P2", "OBS")
julia> SummaryFormatter.print_jackknife_average_error_from_raw(raw_arr, 20, "cond", "OJK")Notes
- Column indices are $1$-based throughout (files and arrays).
- Bootstrap/Jackknife routines return
(mean, std);Deborah.Sarah.SummaryFormatteralso prints a compactAVG(ERR)string and warns whenstd == 0. TOMLLogger.append_section_to_tomlwrites keys usingrepr, preserving Julia-literal fidelity in theTOML.
See Also
- Deborah.Sarah.AvgErrFormatter
- Deborah.Sarah.BlockSizeSuggester
- Deborah.Sarah.Bootstrap
- Deborah.Sarah.BootstrapDataInit
- Deborah.Sarah.BootstrapRunner
- Deborah.Sarah.ControllerCommon
- Deborah.Sarah.DataLoader
- Deborah.Sarah.DatasetPartitioner
- Deborah.Sarah.Jackknife
- Deborah.Sarah.JobLoggerTools
- Deborah.Sarah.NameParser
- Deborah.Sarah.SeedManager
- Deborah.Sarah.StringTranscoder
- Deborah.Sarah.SummaryCollector
- Deborah.Sarah.SummaryFormatter
- Deborah.Sarah.TOMLLogger
- Deborah.Sarah.XYInfoGenerator