diff --git a/luminaire/exploration/data_exploration.py b/luminaire/exploration/data_exploration.py index 8b14d83..9e041bf 100644 --- a/luminaire/exploration/data_exploration.py +++ b/luminaire/exploration/data_exploration.py @@ -14,7 +14,7 @@ class DataExploration(object): :param str freq: The frequency of the time-series. A `Pandas offset`_ such as 'D', 'H', or 'M'. Luminaire currently supports the following pandas frequency types: 'H', 'D', 'W', 'W-SUN', 'W-MON', 'W-TUE', 'W-WED', 'W-THU', - 'W-FRI', 'W-SAT', 'M', 'MS'. + 'W-FRI', 'W-SAT'. :param float sig_level: The significance level to use for any statistical test withing data profile. This should be a number between 0 and 1. :param min_ts_mean: The minimum mean value of the time series required for the model to run. For data that diff --git a/luminaire/model/lad_filtering.py b/luminaire/model/lad_filtering.py index d428ad1..5508296 100644 --- a/luminaire/model/lad_filtering.py +++ b/luminaire/model/lad_filtering.py @@ -42,7 +42,7 @@ class LADFilteringModel(BaseModel): See :class:`luminaire.model.lad_filtering.LADFilteringHyperParams` for detailed information. :param str freq: The frequency of the time-series. A `Pandas offset`_ such as 'D', 'H', or 'M'. Luminaire currently supports the following pandas frequency types: 'H', 'D', 'W', 'W-SUN', 'W-MON', 'W-TUE', 'W-WED', 'W-THU', - 'W-FRI', 'W-SAT', 'M', 'MS'. + 'W-FRI', 'W-SAT'. :param min_ts_length: The minimum required length of the time series for training. :param max_ts_length: The maximum required length of the time series for training. diff --git a/luminaire/model/lad_structural.py b/luminaire/model/lad_structural.py index 66bb01a..c24e9f1 100644 --- a/luminaire/model/lad_structural.py +++ b/luminaire/model/lad_structural.py @@ -54,7 +54,7 @@ class LADStructuralModel(BaseModel): See :class:`luminaire.model.lad_structural.LADStructuralHyperParams` for detailed information. :param str freq: The frequency of the time-series. A `Pandas offset`_ such as 'D', 'H', or 'M'. Luminaire currently supports the following pandas frequency types: 'H', 'D', 'W', 'W-SUN', 'W-MON', 'W-TUE', 'W-WED', 'W-THU', - 'W-FRI', 'W-SAT', 'M', 'MS'. + 'W-FRI', 'W-SAT'. :param int min_ts_length: The minimum required length of the time series for training. :param int max_ts_length: The maximum required length of the time series for training. :param float min_ts_mean: Minimum average values in the most recent window of the time series. This optional diff --git a/luminaire/model/window_density.py b/luminaire/model/window_density.py index 4d2f258..c9f4c1b 100644 --- a/luminaire/model/window_density.py +++ b/luminaire/model/window_density.py @@ -273,7 +273,7 @@ def _training_data_truncation(self, sliced_training_data=None): else: return sliced_training_data - def _call_training(self, training_start, training_end, df=None, window_length=None, min_window_length=None, + def _call_training(self, training_start=None, training_end=None, df=None, window_length=None, min_window_length=None, max_window_length=None, min_num_train_windows=None, max_num_train_windows=None, ignore_window=None, imputed_metric=None, detrend_method=None, **kwargs): """ @@ -302,6 +302,13 @@ def _call_training(self, training_start, training_end, df=None, window_length=No # take first value of timeseries by default training_start = str(df.index.min()) + if training_end: + # if a timeseries start date is provided, take the larger of this or the first timeseries value + training_end = min(df.index.max(), pd.Timestamp(training_end)) + else: + # take first value of timeseries by default + training_end = str(df.index.max()) + training_window = [pd.to_datetime(training_start), pd.to_datetime(training_end)] if window_length < min_window_length: diff --git a/luminaire/optimization/hyperparameter_optimization.py b/luminaire/optimization/hyperparameter_optimization.py index 26e8f0e..b991423 100644 --- a/luminaire/optimization/hyperparameter_optimization.py +++ b/luminaire/optimization/hyperparameter_optimization.py @@ -11,7 +11,7 @@ class HyperparameterOptimization(object): :param str freq: The frequency of the time-series. A `Pandas offset`_ such as 'D', 'H', or 'M'. Luminaire currently supports the following pandas frequency types: 'H', 'D', 'W', 'W-SUN', 'W-MON', 'W-TUE', 'W-WED', 'W-THU', - 'W-FRI', 'W-SAT', 'M', 'MS'. + 'W-FRI', 'W-SAT'. :param str detection_type: Luminaire anomaly detection type. Only Outlier detection for batch data is currently supported. :param min_ts_mean: Minimum average values in the most recent window of the time series. This optional parameter