Skip to content

Commit

Permalink
fix: take mean before calculating the thresholds (#340)
Browse files Browse the repository at this point in the history
take mean before calculating the thresholds

---------

Signed-off-by: s0nicboOm <[email protected]>
  • Loading branch information
s0nicboOm committed Jan 20, 2024
1 parent dbb510f commit 870f263
Show file tree
Hide file tree
Showing 2 changed files with 572 additions and 536 deletions.
6 changes: 3 additions & 3 deletions numalogic/udfs/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ def compute(
"""
_start_time = time.perf_counter()
try:
y_score = model.score_samples(input_).astype(np.float32)
score = np.mean(input_, axis=0, keepdims=True)
y_score = model.score_samples(score).astype(np.float32)
except Exception as err:
raise RuntimeError("Threshold model scoring failed") from err
try:
win_score = np.mean(y_score, axis=0, keepdims=True)
score = postproc_clf.transform(win_score)
score = postproc_clf.transform(y_score)
except Exception as err:
raise RuntimeError("Postprocess failed") from err
_LOGGER.debug(
Expand Down
Loading

0 comments on commit 870f263

Please sign in to comment.