public class OneVSAll extends Object implements Classifier, Parameterized
BinaryScoreClassifier
, then the
winning class label will be the associated classifier that produced the
highest score.Constructor and Description |
---|
OneVSAll(Classifier baseClassifier)
Creates a new One VS All classifier.
|
OneVSAll(Classifier baseClassifier,
boolean concurrentTraining)
Creates a new One VS All classifier.
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
OneVSAll |
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.
|
void |
setConcurrentTraining(boolean concurrentTraining)
Controls what method of parallel training to use when
trainC(jsat.classifiers.ClassificationDataSet, java.util.concurrent.ExecutorService)
is called. |
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.
|
public OneVSAll(Classifier baseClassifier)
baseClassifier
- the base classifier to replicatesetConcurrentTraining(boolean)
public OneVSAll(Classifier baseClassifier, boolean concurrentTraining)
baseClassifier
- the base classifier to replicateconcurrentTraining
- controls whether or not classifiers are trained
simultaneously or using sequentially using their
Classifier.trainC(jsat.classifiers.ClassificationDataSet, java.util.concurrent.ExecutorService)
method.setConcurrentTraining(boolean)
public void setConcurrentTraining(boolean concurrentTraining)
trainC(jsat.classifiers.ClassificationDataSet, java.util.concurrent.ExecutorService)
is called. If set to true, each of the k classifiers will be trained in parallel, using
their serial algorithms. If set to false, the k classifiers will be trained sequentially,
calling the Classifier.trainC(jsat.classifiers.ClassificationDataSet, java.util.concurrent.ExecutorService)
for each classifier. concurrentTraining
- whether or not to train the classifiers in parallelpublic 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 OneVSAll clone()
clone
in interface Classifier
clone
in class Object
public boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
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.