milia.anomaly.models.copod#
COPOD: a skew-weighted empirical copula.
Classes
|
Parameter-free copula detector (Li et al., 2020, IEEE ICDM). |
|
Validated hyperparameters of the COPOD detector. |
- class milia.anomaly.models.copod.COPOD(contamination=0.1)#
Bases:
BaseDetectorParameter-free copula detector (Li et al., 2020, IEEE ICDM).
Per dimension, both tail terms are kept; the tail favoured by the training skewness is compared with the two-tail average and the larger is summed. This matches pyod’s combination rule, implemented directly.
- Parameters:
contamination (
float) – Expected share of outliers, used for the default threshold.
Examples
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> train, cal = rng.normal(size=(200, 2)), rng.normal(size=(100, 2)) >>> model = COPOD().fit(train).calibrate(cal, alpha=0.1) >>> model.flag(np.array([[0.0, 0.0], [8.0, 8.0]])).tolist() [False, True]
- class milia.anomaly.models.copod.COPODConfig(*, name='copod', kind='detector', space=None, contamination=0.1)#
Bases:
BaseModelConfigValidated hyperparameters of the COPOD detector.
Fields mirror
COPOD’s constructor;spaceis the default Optuna search space. Build the detector withmake("detector", "copod", ...)orCOPOD(**config.params()).Examples
>>> COPODConfig().name 'copod'