Skip to content

Commit

Permalink
fixes #55 and #56 (for #56 we take pulling of monthly monitoring supp…
Browse files Browse the repository at this point in the history
…ort for now)
  • Loading branch information
sayanchk committed Aug 24, 2020
1 parent ebd5723 commit 0c203c2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion luminaire/exploration/data_exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion luminaire/model/lad_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion luminaire/model/lad_structural.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion luminaire/model/window_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion luminaire/optimization/hyperparameter_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c203c2

Please sign in to comment.