public class LibSVMAnomalyTrainer extends LibSVMTrainer<Event>
See:
Chang CC, Lin CJ. "LIBSVM: a library for Support Vector Machines" ACM transactions on intelligent systems and technology (TIST), 2011.
and for the anomaly detection algorithm:
Schölkopf B, Platt J, Shawe-Taylor J, Smola A J, Williamson R C. "Estimating the support of a high-dimensional distribution" Neural Computation, 2001, 1443-1471.
parameters, svmType
DEFAULT_SEED
Modifier | Constructor and Description |
---|---|
protected |
LibSVMAnomalyTrainer()
For OLCUT.
|
|
LibSVMAnomalyTrainer(SVMParameters<Event> parameters)
Creates a one-class LibSVM trainer using the supplied parameters.
|
Modifier and Type | Method and Description |
---|---|
protected LibSVMModel<Event> |
createModel(ModelProvenance provenance,
ImmutableFeatureMap featureIDMap,
ImmutableOutputInfo<Event> outputIDInfo,
List<libsvm.svm_model> models)
Construct the appropriate subtype of LibSVMModel for the prediction task.
|
protected com.oracle.labs.mlrg.olcut.util.Pair<libsvm.svm_node[][],double[][]> |
extractData(Dataset<Event> data,
ImmutableOutputInfo<Event> outputInfo,
ImmutableFeatureMap featureMap)
Extracts the features and
Output s in LibLinear's format. |
protected double |
extractOutput(Event output)
Converts an output into a double for use in training.
|
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
LibSVMModel<Event> |
train(Dataset<Event> dataset,
Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
Trains a predictive model using the examples in the given data set.
|
protected List<libsvm.svm_model> |
trainModels(libsvm.svm_parameter curParams,
int numFeatures,
libsvm.svm_node[][] features,
double[][] outputs)
Train all the liblinear instances necessary for this dataset.
|
exampleToNodes, getInvocationCount, getProvenance, setupParameters, toString, train
protected LibSVMAnomalyTrainer()
public LibSVMAnomalyTrainer(SVMParameters<Event> parameters)
parameters
- The training parameters.public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
in class LibSVMTrainer<Event>
public LibSVMModel<Event> train(Dataset<Event> dataset, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
Trainer
train
in interface Trainer<Event>
train
in class LibSVMTrainer<Event>
dataset
- the data set containing the examples.instanceProvenance
- Training run specific provenance (e.g., fold number).protected LibSVMModel<Event> createModel(ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Event> outputIDInfo, List<libsvm.svm_model> models)
LibSVMTrainer
createModel
in class LibSVMTrainer<Event>
provenance
- The model provenance.featureIDMap
- The feature id map.outputIDInfo
- The output id info.models
- The svm models.protected List<libsvm.svm_model> trainModels(libsvm.svm_parameter curParams, int numFeatures, libsvm.svm_node[][] features, double[][] outputs)
LibSVMTrainer
trainModels
in class LibSVMTrainer<Event>
curParams
- The LibLinear parameters.numFeatures
- The number of features in this dataset.features
- The features themselves.outputs
- The outputs.protected com.oracle.labs.mlrg.olcut.util.Pair<libsvm.svm_node[][],double[][]> extractData(Dataset<Event> data, ImmutableOutputInfo<Event> outputInfo, ImmutableFeatureMap featureMap)
LibSVMTrainer
Output
s in LibLinear's format.extractData
in class LibSVMTrainer<Event>
data
- The input data.outputInfo
- The output info.featureMap
- The feature info.protected double extractOutput(Event output)
By convention Event.EventType.EXPECTED
is 1.0, other events are -1.0.
output
- The output to convert.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.