Skip to content

Commit 55c78df

Browse files
committed
minot documentation updates based on the MR comments
1 parent c546765 commit 55c78df

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

luminaire/exploration/data_exploration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ def kf_naive_outlier_detection(self, input_series, idx_position):
810810

811811
residuals = truncated_series - filtered_state_means[:, 0]
812812

813+
# Catching marginal anomalies to avoid during training
813814
is_anomaly = residuals[idx_position] < np.mean(residuals) \
814815
- (1 * np.sqrt(filtered_state_covariance)[idx_position][0][0]) \
815816
or residuals[idx_position] > np.mean(residuals) \

luminaire/model/lad_structural.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ def _validate_model(self, data, hyper_params, result):
443443
:param pandas.DataFrame data: Input time series data
444444
:param dict hyper_params: Hyperparameters for model training
445445
:param dict result: Training outputs
446-
:return: A validation flag for model to publish
446+
:return: A validation flag for model to publish. The function returns True when the validation is successful,
447+
False otherwise.
447448
448449
:rtype: bool
449450
"""
@@ -472,6 +473,9 @@ def _validate_model(self, data, hyper_params, result):
472473
if result['Success']:
473474
predictions.append(result['Prediction'])
474475

476+
# We perform Levene test, Mann-Whitney U test, and Grubb test between the predictions and the baseline
477+
# to understand if the are widely different. The two arrays need to be of the same length in order to
478+
# perform these tests.
475479
if len(predictions) == len(baseline):
476480
N = len(predictions)
477481

@@ -547,6 +551,7 @@ def train(self, data, optimize=False, validate=False, **kwargs):
547551

548552
success = False if 'ErrorMessage' in result else True
549553

554+
# Model validation step to check underfit due to misspecification of hyperparameters to some other reasons.
550555
if success and validate and not optimize:
551556
passed = self._validate_model(data=data, hyper_params=self.hyper_params, result=result)
552557
if not passed:

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# installing latest changes for bayesian-changepoint-detection since the scipy support is not available in pypi yet
12
git+https://github.com/hildensia/bayesian_changepoint_detection@2dd95f5c1d028116899a842ccb3baa173f9d5be9
3+
24
changepy>=0.3.1
35
hyperopt>=0.1.2
46
numpy>=1.17.5

0 commit comments

Comments
 (0)