Package elki.outlier.svm
Class LibSVMOneClassOutlierDetection<V extends NumberVector>
- java.lang.Object
-
- elki.outlier.svm.LibSVMOneClassOutlierDetection<V>
-
- Type Parameters:
V
- vector type
- All Implemented Interfaces:
Algorithm
,OutlierAlgorithm
@Reference(authors="B. Sch\u00f6lkopf, J. C. Platt, J. Shawe-Taylor, A. J. Smola, R. C. Williamson", title="Estimating the support of a high-dimensional distribution", booktitle="Neural computation 13.7", url="https://doi.org/10.1162/089976601750264965", bibkey="DBLP:journals/neco/ScholkopfPSSW01") public class LibSVMOneClassOutlierDetection<V extends NumberVector> extends java.lang.Object implements OutlierAlgorithm
Outlier-detection using one-class support vector machines.Important note: from literature, the one-class SVM is trained as if 0 was the only counterexample. Outliers will only be detected when they are close to the origin in kernel space! In our experience, results from this method are rather mixed, in particular as you would likely need to tune hyperparameters. Results may be better if you have a training data set with positive examples only, then apply it only to new data (which is currently not supported in this implementation, it assumes a single-dataset scenario).
Reference:
B. Schölkopf, J. C. Platt, J. Shawe-Taylor, A. J. Smola, R. C. Williamson
Estimating the support of a high-dimensional distribution
Neural computation 13.7- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LibSVMOneClassOutlierDetection.SVMKernel
Kernel functions.-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double
gamma
Gamma parameter (not for linear kernel)protected LibSVMOneClassOutlierDetection.SVMKernel
kernel
Kernel function in use.private static Logging
LOG
Class logger.(package private) static libsvm.svm_print_interface
LOG_HELPER
Setup logging helper for SVM.(package private) double
nu
Nu parameter.
-
Constructor Summary
Constructors Constructor Description LibSVMOneClassOutlierDetection(LibSVMOneClassOutlierDetection.SVMKernel kernel, double nu, double gamma)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.OutlierResult
run(Relation<V> relation)
Run one-class SVM.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.outlier.OutlierAlgorithm
autorun
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
kernel
protected LibSVMOneClassOutlierDetection.SVMKernel kernel
Kernel function in use.
-
nu
double nu
Nu parameter.
-
gamma
double gamma
Gamma parameter (not for linear kernel)
-
LOG_HELPER
static final libsvm.svm_print_interface LOG_HELPER
Setup logging helper for SVM.
-
-
Constructor Detail
-
LibSVMOneClassOutlierDetection
public LibSVMOneClassOutlierDetection(LibSVMOneClassOutlierDetection.SVMKernel kernel, double nu, double gamma)
Constructor.- Parameters:
kernel
- Kernel to use with SVM.nu
- Nu parametergamma
- Gamma parameter
-
-
Method Detail
-
getInputTypeRestriction
public TypeInformation[] getInputTypeRestriction()
Description copied from interface:Algorithm
Get the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestriction
in interfaceAlgorithm
- Returns:
- Type restriction
-
run
public OutlierResult run(Relation<V> relation)
Run one-class SVM.- Parameters:
relation
- Data relation- Returns:
- Outlier result.
-
-