DOBIN
Distance based Outlier BasIs using Neighbors (DOBIN).
DOBIN is a pre-processing algorithm that constructs a set of basis vectors tailored for outlier detection as described by _[1]. DOBIN has a simple mathematical foundation and can be used as a dimension reduction tool for outlier detection tasks.
Method assumes normalized data, the original R code implementation uses: from sklearn.preprocessing import MinMaxScaler, RobustScaler, StandardScaler This prevents variables with large variances having disproportional influence on Euclidean distances. The original implelemtation _[1] uses MinMaxScaler normalization, and removes NA values before normalization.
We emphasize that DOBIN is not an outlier detection method; rather it is a pre-processing step that can be used by any outlier detection method.
Quickstart
from sktime.transformations.dobin import DOBIN
estimator = DOBIN(frac=0.95, k=None)Parameters(2)
- fracfloat (default=0.95)
- The cut-off quantile for Y space (parameter q in _[1]).
- kint (default=None)
- Number of nearest neighbours considered (parameter k_2 on page 9 in _[1])
Examples
>>> from sktime.transformations.dobin import DOBIN
>>> from sklearn.preprocessing import MinMaxScaler
>>> import numpy as np
>>> import pandas as pd
>>> from sktime.datasets import load_uschange
>>> _, X = load_uschange ()
>>> scaler = MinMaxScaler ()
>>> X = scaler. fit_transform (X)
>>> model = DOBIN ()
>>> X_outlier = model. fit_transform (pd. DataFrame (X))
>>> X_outlier. head () DB0 DB1 DB2 DB3 0 1.151965 0.116488 0.286064 0.288140 1 1.191976 0.100772 0.050835 0.225985 2 1.221158 0.078031 0.034030 0.249676 3 1.042420 0.188494 0.218460 0.205251 4 1.224701 0.020028 -0.294705 0.199827References
Kandanaarachchi, Sevvandi, and Rob J. Hyndman. “Dimension reduction
for outlier detection using DOBIN.” Journal of Computational and Graphical Statistics 30.1 (2021): 204-219.