jsat.classifiers
Class PriorClassifier
- java.lang.Object
-
- jsat.classifiers.PriorClassifier
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier
public class PriorClassifier extends java.lang.Object implements Classifier
A Naive classifier that simply returns the prior probabilities as the classification decision.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PriorClassifier()Creates a new PriorClassifeirPriorClassifier(CategoricalResults cr)Creates a new Prior Classifier that is given the results it should be returning
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.Classifierclone()booleansupportsWeightedData()Indicates whether the model knows how to train using weighted data points.voidtrain(ClassificationDataSet dataSet)Trains the classifier and constructs a model for classification using the given data set.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.
-
-
-
Constructor Detail
-
PriorClassifier
public PriorClassifier()
Creates a new PriorClassifeir
-
PriorClassifier
public PriorClassifier(CategoricalResults cr)
Creates a new Prior Classifier that is given the results it should be returning- Parameters:
cr- the prior probabilities for classification
-
-
Method Detail
-
classify
public CategoricalResults classify(DataPoint data)
Description copied from interface:ClassifierPerforms classification on the given data point.- Specified by:
classifyin interfaceClassifier- Parameters:
data- the data point to classify- Returns:
- the results of the classification.
-
train
public void train(ClassificationDataSet dataSet, boolean parallel)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.- Specified by:
trainin interfaceClassifier- Parameters:
dataSet- the data set to train onparallel-trueif multiple threads should be used to train the model.falseif it should be done in a single threaded manner.
-
train
public void train(ClassificationDataSet dataSet)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set.- Specified by:
trainin interfaceClassifier- Parameters:
dataSet- the data set to train on
-
supportsWeightedData
public boolean supportsWeightedData()
Description copied from interface:ClassifierIndicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.- Specified by:
supportsWeightedDatain interfaceClassifier- Returns:
- true if the model supports weighted data, false otherwise
-
clone
public Classifier clone()
- Specified by:
clonein interfaceClassifier- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG