Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn user on automatic modify of algorithm or parameters #59

Open
devinaconley opened this issue Apr 4, 2019 · 0 comments
Open

Warn user on automatic modify of algorithm or parameters #59

devinaconley opened this issue Apr 4, 2019 · 0 comments

Comments

@devinaconley
Copy link

Please throw a warning message to the user when automatically modifying parameters or algorithms. Doing this silently makes it extremely difficulty to debug and fine-tune.

def _sanity_check(self):
"""
Check if there are enough data points.
"""
windows = self.lag_window_size + self.future_window_size
if (not self.lag_window_size or not self.future_window_size or self.time_series_length < windows or windows < DEFAULT_BITMAP_MINIMAL_POINTS_IN_WINDOWS):
raise exceptions.NotEnoughDataPoints
# If window size is too big, too many data points will be assigned a score of 0 in the first lag window
# and the last future window.
if self.lag_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
self.lag_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS
if self.future_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
self.future_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS

def _detect(self, score_only):
"""
Detect anomaly periods.
:param bool score_only: if true, only anomaly scores are computed.
"""
try:
algorithm = self.algorithm(**self.algorithm_params)
self.anom_scores = algorithm.run()
except exceptions.NotEnoughDataPoints:
algorithm = anomaly_detector_algorithms['default_detector'](self.time_series)
self.threshold = self.threshold or ANOMALY_THRESHOLD['default_detector']
self.anom_scores = algorithm.run()
if not score_only:
self._detect_anomalies()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant