-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
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.
luminol/src/luminol/algorithms/anomaly_detector_algorithms/bitmap_detector.py
Lines 60 to 73 in 42e4ab9
| 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 |
luminol/src/luminol/anomaly_detector.py
Lines 91 to 104 in 42e4ab9
| 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() |
Metadata
Metadata
Assignees
Labels
No labels