Skip to content

Commit

Permalink
minor changes in variable ingestion and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanchk committed Feb 23, 2021
1 parent 291f1f3 commit ee24284
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions luminaire/model/window_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _call_training(self, df=None, window_length=None, imputed_metric=None, detre
agg_data_model = dict()
agg_data = dict()

past_model = kwargs['past_model'] if 'past_model' in kwargs else None
past_model = kwargs.get('past_model')
training_start = df.first_valid_index()
training_end = df.last_valid_index()
current_training_end = training_end
Expand Down Expand Up @@ -300,6 +300,9 @@ def _get_model(self, input_df=None, window_length=None, value_column=None, detre
from itertools import chain
import scipy.stats as st

model_history_truncation_prop = 0.25 # This is the proportion of history to truncate from both sides
# everytime we store the past anomaly scores

de_obj = DataExploration()
sliced_training_data, agg_datetime = de_obj._partition(input_df, window_length, value_column)

Expand Down Expand Up @@ -331,7 +334,8 @@ def _get_model(self, input_df=None, window_length=None, value_column=None, detre
current_min_timedelta = temp_timedelta

past_anomaly_scores = np.concatenate([past_model._params['PastAnomalyScores'][opt_timestamp][
int(len(past_anomaly_scores) / 4): -int(len(past_anomaly_scores) / 4)]
int(len(past_anomaly_scores) * model_history_truncation_prop):
-int(len(past_anomaly_scores) * model_history_truncation_prop)]
, past_anomaly_scores])

if len(past_anomaly_scores) < 100:
Expand Down

0 comments on commit ee24284

Please sign in to comment.