Skip to content

Commit

Permalink
Casing a numpy float to a python float in the anomaly function.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrczarnas committed Oct 11, 2024
1 parent df9a89e commit cbf9ea0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions home/lib/anomalies/anomaly_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def detect_upper_bound_anomaly(values_above_median: list[float], degrees_of_free
values_std = scipy.stats.tstd(values_array)

if float(values_std) == 0:
return values_median
return float(values_median)
else:
# Assumption: the historical data follows t-student distribution
upper_readout_distribution = scipy.stats.t(df=degrees_of_freedom, loc=values_median,
Expand All @@ -65,7 +65,7 @@ def detect_lower_bound_anomaly(values_below_median: list[float], degrees_of_free
values_std = scipy.stats.tstd(values_array)

if float(values_std) == 0:
return values_median
return float(values_median)
else:
# Assumption: the historical data follows t-student distribution
lower_readout_distribution = scipy.stats.t(df=degrees_of_freedom, loc=values_median,
Expand Down

0 comments on commit cbf9ea0

Please sign in to comment.