Inspect and audit a dataset¶
Use rfgen inspect to run a read-only audit before training, publication, or
Phase 2 annotation. The command reads stored metadata, not IQ samples, and
prints one JSON object containing the audit report and a bounded metadata
sample.
When to use this¶
Run the inspection after a local smoke run, production generation run, resume, or export. Run it again after changing the requested class distribution, SNR grid, overlap rate, or spectral occupancy target.
Inspect a local dataset¶
Pass the dataset URI or path. The default storage backend is zarr_local, and
the default metadata sample contains three records.
rfgen inspect ./out/local-smoke
Choose a different shipped or plugin-provided storage backend with --backend:
rfgen inspect gs://rf-fm-datasets-synth/wideband/v0.5.0 \
--backend zarr_gcs
Set --sample-size 0 when only the aggregate report is needed. Valid sample
sizes range from 0 through 100.
rfgen inspect ./out/local-smoke --sample-size 0
rfgen inspect ./out/local-smoke --sample-size 10
The command opens the store in read mode and never modifies its contents.
Read the output¶
The command emits a JSON object with two top-level keys:
reportcontains the aggregate audit fields.recordscontains at mostsample_sizemetadata-only stored records.
The report includes:
Field |
Interpretation |
|---|---|
|
Number of metadata records inspected. |
|
Realized SNR minimum, maximum, mean, and approximate p10, p50, and p90. |
|
Realized emitter count by canonical class name. |
|
Mean realized cochannel-overlap rate. |
|
Mean realized spectral occupancy. |
|
Realized record count by emitter count. |
|
Requested record count by emitter count when requested metadata is present. |
|
The deterministic bottom-hash reservoir method used for SNR quantiles. |
|
Number of SNR observations retained for quantiles, at most |
|
Number of requested-SNR buckets compared. |
SNR count, minimum, maximum, and mean accumulation is exact. The three
quantiles are deterministic approximations from at most 10_000 retained SNR
observations, so do not treat them as exact percentiles for larger datasets.
Understand audit failures¶
When requested targets are present in stored metadata, the audit compares them with realized values. The default tolerances are:
Comparison |
Default tolerance |
|---|---|
Mean realized SNR per requested-SNR bucket |
|
Realized class distribution |
|
Mean cochannel-overlap rate |
|
Mean spectral occupancy |
|
Exceeding a tolerance raises a structured ValidationError with a per-metric
breakdown. Records without the corresponding requested target do not
participate in that comparison.
Configure audit bounds¶
AuditConfig prevents unbounded audit state. Its default limits are:
Field |
Default |
|---|---|
|
|
|
|
|
|
|
|
Exceeding a bound raises a structured ValidationError. Raise a limit only
when the dataset size, taxonomy, requested SNR grid, or emitter-count range
intentionally requires it. The current CLI uses the defaults; call
audit_dataset(store, config=AuditConfig(...)) from Python to supply custom
thresholds or bounds.
AuditConfig bounds metadata cardinality as well as record count. The Python
and Hydra field names are max_class_cardinality,
max_snr_bucket_cardinality, and max_emitter_count_cardinality; each
defaults to 10_000. A dataset exceeding any bound fails with a structured
ValidationError instead of allowing an unbounded histogram or SNR-bucket map
to grow in memory. Raise a bound only when the dataset taxonomy or requested
SNR grid intentionally requires it.
Troubleshoot¶
Symptom |
Fix |
|---|---|
Missing records |
Re-run the same generation command; completed shards are skipped. |
Unexpected class balance |
Inspect the resolved generation config and requested class distribution. |
SNR threshold failure |
Compare the reported bucket error with the requested SNR metadata and channel configuration. |
Cardinality-bound failure |
Check for malformed or unexpectedly unique class, SNR, or emitter-count values before raising the bound. |
Too much record detail in output |
Set |