public class BestClassDistribution extends Object implements Classifier, Parameterized
MultivariateDistribution
to each class. The distribution
is supplied by the user, and each class if fit to the same type of distribution. Classification is then performed by returning
the class of the most likely distribution given the data point.Modifier and Type | Field and Description |
---|---|
static boolean |
USE_PRIORS
The default value for whether or not to use the prior probability of a
class when making classification decisions is true.
|
Constructor and Description |
---|
BestClassDistribution(BestClassDistribution toCopy)
Copy constructor
|
BestClassDistribution(MultivariateDistribution baseDist) |
BestClassDistribution(MultivariateDistribution baseDist,
boolean usePriors) |
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
Classifier |
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 |
isUsePriors()
Returns whether or not this object uses the prior probabilities for classification.
|
void |
setUsePriors(boolean usePriors)
Controls whether or not the priors will be used for classification.
|
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 static final boolean USE_PRIORS
public BestClassDistribution(MultivariateDistribution baseDist)
public BestClassDistribution(MultivariateDistribution baseDist, boolean usePriors)
public BestClassDistribution(BestClassDistribution toCopy)
toCopy
- the object to copypublic void setUsePriors(boolean usePriors)
usePriors
- true to use the prior probabilities for each class, false to ignore them.public boolean isUsePriors()
true
if the prior probabilities are being used,
false
if not.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 Classifier 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.