Called out in the README's "Anomaly detection: Node vs Python" table — the TS core supports a configurable z-score threshold, Python doesn't. In python/obyflow-python/obyflow/analysis/stats.py:
def classify_severity(z_score: float) -> DeviationSeverity:
abs_z = abs(z_score)
if abs_z < 1:
return "none"
if abs_z < 2:
return "low"
if abs_z < 3:
return "medium"
return "high"
The 1/2/3 cutoffs are fixed. Should let callers pass their own.
- Add optional threshold params to
classify_severity, e.g. low_threshold=1.0, medium_threshold=2.0, high_threshold=3.0
- Thread them through as kwargs in
detect_ml_anomalies (analysis/anomaly.py), the only caller
- Add tests in
test_analysis_stats.py / test_analysis_anomaly.py for non-default thresholds
- Update the README table
Called out in the README's "Anomaly detection: Node vs Python" table — the TS core supports a configurable z-score threshold, Python doesn't. In
python/obyflow-python/obyflow/analysis/stats.py:The 1/2/3 cutoffs are fixed. Should let callers pass their own.
classify_severity, e.g.low_threshold=1.0, medium_threshold=2.0, high_threshold=3.0detect_ml_anomalies(analysis/anomaly.py), the only callertest_analysis_stats.py/test_analysis_anomaly.pyfor non-default thresholds