T
- The type of class/category predicted by the modelpublic class UnivariateGaussianNaiveBayesModel<T> extends Object implements EstimatableModel<Double,T>
EstimatableModel
that uses a
VectorNaiveBayesCategorizer
to associate a univariate (a
Double
) with a category.Constructor and Description |
---|
UnivariateGaussianNaiveBayesModel()
Default constructor.
|
UnivariateGaussianNaiveBayesModel(gov.sandia.cognition.learning.algorithm.bayes.VectorNaiveBayesCategorizer<T,gov.sandia.cognition.statistics.distribution.UnivariateGaussian.PDF> model)
Construct with a pre-trained model.
|
Modifier and Type | Method and Description |
---|---|
UnivariateGaussianNaiveBayesModel<T> |
clone()
Clone the model
|
boolean |
estimate(List<? extends IndependentPair<Double,T>> data)
Estimates the model from the observations in the list of data.
|
Map<T,gov.sandia.cognition.statistics.distribution.UnivariateGaussian> |
getClassDistribution()
Get the class distribution for all classes.
|
gov.sandia.cognition.statistics.distribution.UnivariateGaussian |
getClassDistribution(T clz)
Get the class distribution for the given class.
|
gov.sandia.cognition.statistics.DataHistogram<T> |
getClassPriors() |
static void |
main(String[] args)
Testing
|
int |
numItemsToEstimate() |
T |
predict(Double data)
Uses the model to predict dependent data from an independent value.
|
public UnivariateGaussianNaiveBayesModel()
public UnivariateGaussianNaiveBayesModel(gov.sandia.cognition.learning.algorithm.bayes.VectorNaiveBayesCategorizer<T,gov.sandia.cognition.statistics.distribution.UnivariateGaussian.PDF> model)
model
- the pre-trained model.public boolean estimate(List<? extends IndependentPair<Double,T>> data)
EstimatableModel
EstimatableModel.numItemsToEstimate()
pairs of dependent
and independent data. It may contain more, in which case the estimate
method may choose to make use of this data for validation, or obtaining a
better model by a least squares method for example.estimate
in interface EstimatableModel<Double,T>
data
- Data with which to estimate the modelEstimatableModel.numItemsToEstimate()
public T predict(Double data)
Model
public int numItemsToEstimate()
numItemsToEstimate
in interface EstimatableModel<Double,T>
public UnivariateGaussianNaiveBayesModel<T> clone()
EstimatableModel
public gov.sandia.cognition.statistics.distribution.UnivariateGaussian getClassDistribution(T clz)
clz
- the classpublic Map<T,gov.sandia.cognition.statistics.distribution.UnivariateGaussian> getClassDistribution()
public gov.sandia.cognition.statistics.DataHistogram<T> getClassPriors()