jsat.classifiers.bayesian
Class AODE
- java.lang.Object
-
- jsat.classifiers.BaseUpdateableClassifier
-
- jsat.classifiers.bayesian.AODE
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, UpdateableClassifier
public class AODE extends BaseUpdateableClassifier
Averaged One-Dependence Estimators (AODE) is an extension of Naive Bayes that attempts to be more accurate by reducing the independence assumption. For n data points with d categorical features, dODEclassifier are created, each with a dependence on a different attribute. The results of these classifiers is averaged to produce a final result. The construction time is O(n d2). Because of this extra dependence requirement, the implementation only allows for categorical features.
See: Webb, G., & Boughton, J. (2005). Not so naive bayes: Aggregating one-dependence estimators. Machine Learning, 1–24. Retrieved from here- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AODE()Creates a new AODE classifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.AODEclone()doublegetM()Returns the minimum needed scorevoidsetM(double m)Sets the minimum prior observation value needed for an attribute combination to have enough support to be included in the final estimate.voidsetUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)Prepares the classifier to begin learning from itsUpdateableClassifier.update(jsat.classifiers.DataPoint, int)method.booleansupportsWeightedData()Indicates whether the model knows how to train using weighted data points.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.voidupdate(DataPoint dataPoint, int targetClass)Updates the classifier by giving it a new data point to learn from.-
Methods inherited from class jsat.classifiers.BaseUpdateableClassifier
getEpochs, setEpochs, train, trainEpochs
-
-
-
-
Method Detail
-
clone
public AODE clone()
- Specified by:
clonein interfaceClassifier- Specified by:
clonein interfaceUpdateableClassifier- Specified by:
clonein classBaseUpdateableClassifier
-
setUp
public void setUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)
Description copied from interface:UpdateableClassifierPrepares the classifier to begin learning from itsUpdateableClassifier.update(jsat.classifiers.DataPoint, int)method.- Parameters:
categoricalAttributes- an array containing the categorical attributes that will be in each data pointnumericAttributes- the number of numeric attributes that will be in each data pointpredicting- the information for the target class that will be predicted
-
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- Overrides:
trainin classBaseUpdateableClassifier- 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.
-
update
public void update(DataPoint dataPoint, int targetClass)
Description copied from interface:UpdateableClassifierUpdates the classifier by giving it a new data point to learn from.- Parameters:
dataPoint- the data point to learntargetClass- the target class of the data point
-
classify
public CategoricalResults classify(DataPoint data)
Description copied from interface:ClassifierPerforms classification on the given data point.- Parameters:
data- the data point to classify- Returns:
- the results of the classification.
-
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.- Returns:
- true if the model supports weighted data, false otherwise
-
setM
public void setM(double m)
Sets the minimum prior observation value needed for an attribute combination to have enough support to be included in the final estimate.- Parameters:
m- the minimum needed score
-
getM
public double getM()
Returns the minimum needed score- Returns:
- the minimum needed score
-
-
DataMelt 3.0 © DataMelt by jWork.ORG