Diagnostics#
Rich metadata returned with every offline detection result.
Diagnostics#
Accessible via result.diagnostics.
Properties#
Property |
Type |
Description |
|---|---|---|
|
|
Number of observations in the input |
|
|
Number of dimensions (1 for univariate) |
|
|
JSON schema version marker |
|
|
Rust engine version string |
|
|
Detection runtime in milliseconds |
|
|
Informational notes (e.g., penalty path results) |
|
|
Warning messages (e.g., masking risk) |
|
|
Algorithm name (e.g., |
|
|
Cost model name (e.g., |
|
|
RNG seed (for WBS and randomized methods) |
|
|
Reproducibility mode ( |
|
|
Number of threads used |
|
|
BLAS backend name ( |
|
|
Detected CPU features (e.g., |
|
|
Build provenance and adapter context (omitted when unavailable) |
|
|
Algorithm-specific parameters as JSON |
|
|
Pruning statistics (PELT/FPOP only) |
|
|
Missing data policy used |
|
|
Fraction of missing values in input |
|
|
Count of non-missing observations |
Example#
result = cpd.Pelt(model="l2").fit(x).predict(pen="bic")
diag = result.diagnostics
print(f"Algorithm: {diag.algorithm}")
print(f"Cost model: {diag.cost_model}")
print(f"Runtime: {diag.runtime_ms}ms")
print(f"Repro mode: {diag.repro_mode}")
if diag.pruning_stats:
print(f"Candidates pruned: {diag.pruning_stats.candidates_pruned}")
if diag.warnings:
for w in diag.warnings:
print(f"Warning: {w}")
BuildInfo#
Optional build provenance object exposed via result.diagnostics.build.
Properties#
Property |
Type |
Description |
|---|---|---|
|
|
Build-time commit SHA (best effort) |
|
|
Build-time dirty flag (best effort) |
|
|
Rust compiler version used for build |
|
|
Rust target triple |
|
|
Cargo profile ( |
|
|
Enabled adapter/runtime feature flags |
|
|
Adapter ABI context (for Python: |
PruningStats#
Pruning statistics for PELT and FPOP detectors.
Properties#
Property |
Type |
Description |
|---|---|---|
|
|
Total number of candidate split points evaluated |
|
|
Number of candidates removed by the pruning rule |
SegmentStats#
Per-segment statistics included in the result when available.
Properties#
Property |
Type |
Description |
|---|---|---|
|
|
Segment start index (inclusive) |
|
|
Segment end index (exclusive) |
|
|
Per-dimension mean values |
|
|
Per-dimension variance values |
|
|
Number of observations in the segment |
|
|
Number of missing values in the segment |
Example#
if result.segments:
for seg in result.segments:
print(f"Segment [{seg.start}, {seg.end}): "
f"mean={seg.mean}, count={seg.count}")