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, random_state=None, **kwargs)[source]¶
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’. 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’.
detection_type (str) – Luminaire anomaly detection type. Only Outlier detection for batch data is currently supported.
min_ts_mean (float) – 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) – The maximum required length of the time series for training.
min_ts_length (int) – The minimum required length of the time series for training. The input time series will be truncated if the length is greater than this value.
scoring_length (int) – Number of innovations to be scored after training window with respect to the frequency.
random_state (int) – Turn seed into a np.random.RandomState instance
- run(data, max_evals=50)[source]¶
This function runs hyperparameter optimization fort LAD batch outlier detection models
- Parameters:
data (list[list]) – Input time series.
max_evals (int) – 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}