Luminaire Configuration Optimization

class luminaire.optimization.hyperparameter_optimization.HyperparameterOptimization(freq, detection_type='OutlierDetection', min_ts_mean=None, max_ts_length=None, min_ts_length=None, scoring_length=None, **kwargs)

Hyperparameter optimization for LAD outlier detection configuration for batch data.

Parameters
  • freq (str) – The frequency of the time-series. A Pandas offset such as ‘D’, ‘H’, or ‘M’.

  • detection_type (str, optional) – Luminaire anomaly detection type. Only Outlier detection for batch data is currently supported.

  • min_ts_mean (float, optional) – Minimum average values in the most recent window of the time series. This optional parameter can be used to avoid over-alerting from noisy low volume time series.

  • max_ts_length (int, optional) – The maximum required length of the time series for training.

  • min_ts_length (int, optional) – The minimum required length of the time series for training.

  • scoring_length (int, optional) – Number of innovations to be scored after training window with respect to the frequency.

run(data, max_evals=40)

This function runs hyperparameter optimization fort LAD batch outlier detection models

Parameters
  • data (list[list]) – Input time series.

  • max_evals (int, optional) – Number of iterations for hyperparameter optimization.

Returns

Optimal hyperparameters.

Return type

dict

>>> data
[[Timestamp('2020-01-01 00:00:00'), 1326.0],
[Timestamp('2020-01-02 00:00:00'), 1552.0],
[Timestamp('2020-01-03 00:00:00'), 1432.0],
. . . ,
[Timestamp('2020-06-06 00:00:00'), 1747.0],
[Timestamp('2020-06-07 00:00:00'), 1782.0]]
>>> hopt_obj = HyperparameterOptimization(freq='D', detection_type='OutlierDetection')
>>> hyper_params = hopt_obj._run(data=data, max_evals=5)
>>> hyper_params
{'LuminaireModel': 'LADStructuralModel', 'data_shift_truncate': 0, 'fill_rate': 0.8409249603686499,
'include_holidays_exog': 1, 'is_log_transformed': 1, 'max_ft_freq': 3, 'p': 4, 'q': 3}