public class OneVSOne extends Object implements Classifier, Parameterized
Modifier and Type | Field and Description |
---|---|
protected Classifier |
baseClassifier
Main binary classifier
|
protected Classifier[][] |
oneVone
Uper-diagonal matrix of classifiers sans the first index since a
classifier vs itself is useless.
|
protected CategoricalData |
predicting |
Constructor and Description |
---|
OneVSOne(Classifier baseClassifier)
Creates a new One-vs-One classifier
|
OneVSOne(Classifier baseClassifier,
boolean concurrentTrain)
Creates a new One-vs-One classifier
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
OneVSOne |
clone() |
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
boolean |
isConcurrentTraining() |
void |
setConcurrentTraining(boolean concurrentTrain)
Controls whether or not training of the several classifiers occurs concurrently or sequentually.
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
trainC(ClassificationDataSet dataSet)
Trains the classifier and constructs a model for classification using the
given data set.
|
void |
trainC(ClassificationDataSet dataSet,
ExecutorService threadPool)
Trains the classifier and constructs a model for classification using the
given data set.
|
protected Classifier baseClassifier
protected Classifier[][] oneVone
protected CategoricalData predicting
public OneVSOne(Classifier baseClassifier)
baseClassifier
- the binary classifier to extendpublic OneVSOne(Classifier baseClassifier, boolean concurrentTrain)
baseClassifier
- the binary classifier to extendconcurrentTrain
- true to have training of individual
classifiers occur in parallel, false to have them use their
native parallel training method.public void setConcurrentTraining(boolean concurrentTrain)
concurrentTrain
- true to have training of individual
classifiers occur in parallel, false to have them use their
native parallel training method.public boolean isConcurrentTraining()
public CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.public void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public OneVSOne clone()
clone
in interface Classifier
clone
in class Object
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.