LOF

class frlearn.data_descriptors.LOF(dissimilarity: str = 'boscovich', k: int = <function log_multiple.<locals>._f>, nn_search: ~frlearn.neighbours.neighbour_search_methods.NeighbourSearchMethod = <frlearn.neighbours.neighbour_search_methods.KDTree object>, preprocessors=(<frlearn.statistics.feature_preprocessors.IQRNormaliser object>, ))[source]

Implementation of the Local Outlier Factor (LOF) data descriptor [1].

Parameters
dissimilarity: str or float or (np.array -> float) or ((np.array, np.array) -> float) = ‘boscovich’

The dissimilarity measure to use.

A vector size measure np.array -> float induces a dissimilarity measure through application to y - x. A float is interpreted as Minkowski size with the corresponding value for p. For convenience, a number of popular measures can be referred to by name.

The default is the Boscovich norm (also known as cityblock, Manhattan or taxicab norm).

kint or (int -> float) or None = 2.5 * log n

How many nearest neighbours to consider. Should be either a positive integer, or a function that takes the target class size n and returns a float, or None, which is resolved as n. All such values are rounded to the nearest integer in [1, n].

preprocessorsiterable = (IQRNormaliser(), )

Preprocessors to apply. The default interquartile range normaliser rescales all features to ensure that they all have the same interquartile range.

Notes

The scores are derived with 1/(1 + lof). k is the principal hyperparameter that can be tuned to increase performance. Its default value is based on the empirical evaluation in [2].

References

1

Breunig MM, Kriegel H-P, Ng RT, Sander J (2000). LOF: identifying density-based local outliers. SIGMOD 2000: ACM international conference on Management of data, 93–104. ACM. doi: 10.1145/342009.335388

2

Lenz OU, Peralta D, Cornelis C (2021). Average Localised Proximity: A new data descriptor with good default one-class classification performance. Pattern Recognition, vol 118, no 107991. doi: 10.1016/j.patcog.2021.107991

class Model[source]

Examples using frlearn.data_descriptors.LOF