Skip to content

Commit

Permalink
fix module split for zscore
Browse files Browse the repository at this point in the history
  • Loading branch information
drewrip committed Jan 31, 2024
1 parent 0929b7a commit e781630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion matrix_benchmarking/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def tostr(self):

return model

class RegressionResult():
class RegressionResult(ExclusiveModel):
kpi: str
indicator: str
status: int
Expand Down
10 changes: 7 additions & 3 deletions matrix_benchmarking/regression/zscore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
class ZScoreIndicator(RegressionIndicator):
from matrix_benchmarking import regression

import numpy as np

class ZScoreIndicator(regression.RegressionIndicator):
"""
Example regression indicator that uses the Z score as a metric
to determine if the recent test was an outlier
Expand All @@ -10,7 +14,7 @@ def __init__(self, *args, threshold=3, **kwargs):
def get_name(self):
return f"ZScoreIndicator(threshold={self.threshold})"

def regression_test(self, new_result: float, lts_results: np.array) -> RegressionStatus:
def regression_test(self, new_result: float, lts_results: np.array) -> regression.RegressionStatus:
"""
Determine if the curr_result is more/less than threshold
standard deviations away from the previous_results
Expand All @@ -27,4 +31,4 @@ def regression_test(self, new_result: float, lts_results: np.array) -> Regressio
direction = 1 if z_score > 0 else -1,
explanation="z-score greater than threshold",

return RegressionStatus(0, direction=direction, explanation=explanation, details=details)
return regression.RegressionStatus(0, direction=direction, explanation=explanation, details=details)

0 comments on commit e781630

Please sign in to comment.