Evaluation¶
Signal quality metrics and artifact generation for compression evaluation.
Metrics¶
compressionkit.evaluation.metrics.PRD
¶
Bases: Metric
Percent RMS difference metric with optional energy normalization.
Source code in compressionkit/evaluation/metrics.py
compressionkit.evaluation.metrics.TruePRD
¶
Bases: PRD
Normalized PRD metric (convenience alias).
Source code in compressionkit/evaluation/metrics.py
compressionkit.evaluation.metrics.compute_signal_metrics(original, reconstructed)
¶
Compute scalar reconstruction metrics on two aligned signals.
Source code in compressionkit/evaluation/metrics.py
compressionkit.evaluation.metrics.compute_ppg_physiokit_metrics(signal, *, sample_rate, low_hz, high_hz, order, min_peaks)
¶
Compute HR/HRV metrics for one PPG signal using physiokit.
Source code in compressionkit/evaluation/metrics.py
compressionkit.evaluation.metrics.summarize_physiokit_alignment(originals, reconstructions, *, sample_rate, low_hz, high_hz, order, min_peaks)
¶
Compare physiokit HR/HRV metrics between original and reconstructed signals.
Source code in compressionkit/evaluation/metrics.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
Artifacts¶
compressionkit.evaluation.artifacts.save_sample_artifacts(sample_id, original, reconstructed, sampling_rate, run_dir, band_original=None, band_reconstructed=None, physiokit_metrics=None)
¶
Save per-sample CSV, plot, and compute metrics for one evaluation sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_id
|
int
|
Index of the evaluation sample. |
required |
original
|
ndarray
|
Original signal (1D or squeezable). |
required |
reconstructed
|
ndarray
|
Reconstructed signal (1D or squeezable). |
required |
sampling_rate
|
int
|
Signal sampling rate in Hz. |
required |
run_dir
|
Path
|
Directory to write artifacts into. |
required |
band_original
|
ndarray | None
|
Optional band-filtered original for band metrics. |
None
|
band_reconstructed
|
ndarray | None
|
Optional band-filtered reconstruction. |
None
|
physiokit_metrics
|
dict[str, Any] | None
|
Optional physiokit metrics dict for this sample. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with paths and metric values. |