May 2020
Intermediate to advanced
530 pages
17h 8m
English
Anomaly detection algorithms in the Shogun library are represented with the OCSVM algorithm. This algorithm is implemented in two classes: CSVMLightOneClass and CLibSVMOneClass. Note that they have different backends for SVM implementation: the former uses the SVMLight library (http://svmlight.joachims.org/), while the latter uses the LibSVM library (https://www.csie.ntu.edu.tw/~cjlin/libsvm/).
Let's start by looking at using the CLibSVMOneClass class for anomaly detection:
auto csv_file = some<CCSVFile>(dataset_name.string().c_str()); Matrix data; data.load(csv_file); Matrix train = data.submatrix(0, 50); train = train.clone(); Matrix test = data.submatrix(50, data.num_cols); test = test.clone(); // create a dataset ...
Read now
Unlock full access