diff --git a/dtaianomaly/anomaly_detection/BaseDetector.py b/dtaianomaly/anomaly_detection/BaseDetector.py index 8b2a5ae..4ece293 100644 --- a/dtaianomaly/anomaly_detection/BaseDetector.py +++ b/dtaianomaly/anomaly_detection/BaseDetector.py @@ -46,7 +46,7 @@ def __init__(self, supervision: Supervision): self.supervision = supervision @abc.abstractmethod - def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> 'BaseDetector': + def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> 'BaseDetector': """ Abstract method, fit this detector to the given data. diff --git a/dtaianomaly/anomaly_detection/MedianMethod.py b/dtaianomaly/anomaly_detection/MedianMethod.py index bb9a54c..6249aa5 100644 --- a/dtaianomaly/anomaly_detection/MedianMethod.py +++ b/dtaianomaly/anomaly_detection/MedianMethod.py @@ -67,7 +67,7 @@ def __init__(self, neighborhood_size_before: int, neighborhood_size_after: Optio self.neighborhood_size_before = neighborhood_size_before self.neighborhood_size_after = neighborhood_size_after - def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> 'BaseDetector': + def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> 'BaseDetector': return self # No fitting is required. def decision_function(self, X: np.ndarray) -> np.ndarray: diff --git a/dtaianomaly/anomaly_detection/baselines/baselines.py b/dtaianomaly/anomaly_detection/baselines/baselines.py index 1e497b1..c82f5d8 100644 --- a/dtaianomaly/anomaly_detection/baselines/baselines.py +++ b/dtaianomaly/anomaly_detection/baselines/baselines.py @@ -15,7 +15,7 @@ class AlwaysNormal(BaseDetector): def __init__(self): super().__init__(Supervision.UNSUPERVISED) - def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> 'AlwaysNormal': + def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> 'AlwaysNormal': """ Simply return this detector, because no fitting is required. @@ -67,7 +67,7 @@ class AlwaysAnomalous(BaseDetector): def __init__(self): super().__init__(Supervision.UNSUPERVISED) - def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> 'AlwaysAnomalous': + def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> 'AlwaysAnomalous': """ Simply return this detector, because no fitting is required. @@ -126,7 +126,7 @@ def __init__(self, seed: Optional[int] = None): super().__init__(Supervision.UNSUPERVISED) self.seed = seed - def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> 'RandomDetector': + def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> 'RandomDetector': """ Simply return this detector, because no fitting is required. diff --git a/dtaianomaly/anomaly_detection/windowing_utils.py b/dtaianomaly/anomaly_detection/windowing_utils.py index af2aeac..1e1a87a 100644 --- a/dtaianomaly/anomaly_detection/windowing_utils.py +++ b/dtaianomaly/anomaly_detection/windowing_utils.py @@ -192,7 +192,6 @@ def compute_window_size( # Use the fft to compute a window size elif window_size == 'fft': - print('REACHED') window_size_ = _dominant_fourier_frequency(X, lower_bound=lower_bound, upper_bound=upper_bound) # Use the acf to compute a window size