SVM

class frlearn.data_descriptors.SVM(nu: float = 0.2, c: float | Callable[[int], float] = <function multiple.<locals>._f>, preprocessors=(<frlearn.statistics.feature_preprocessors.IQRNormaliser object>,), **sklearn_params)[source]

Wrapper for the Support Vector Machine (SVM) data descriptor [1] with gaussian kernel, implemented in scikit-learn. Expresses the signed distance to the separating hyperplane, scaled to [0, 1].

Parameters
nufloat = 0.20

How many nearest neighbour distances / localised proximities to consider. Corresponds to the scale at which proximity is evaluated. Should be either a positive integer not larger than the target class size, or a function that takes the size of the target class and returns such an integer.

cfloat or (int -> float) = 0.25 * m

Kernel width. Should be either a positive float or a function that takes the dimensionality of the target class and returns such a float.

preprocessorsiterable = (IQRNormaliser(), )

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

sklearn_params

Additional keyword parameters will be passed on as-is to scikit-learn’s OneClassSVM constructor.

Notes

nu and c are the two principal hyperparameters that can be tuned to increase performance. Its default values are based on the empirical evaluation in [2].

References

1

Schölkopf B, Platt JC, Shawe-Taylor J, Smola AJ, Williamson RC (1999). Estimating the support of a high-dimensional distribution. MSR-TR-99-87, Microsoft Research.

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.SVM