public class CvNormalBayesClassifier extends CvStatModel
Bayes classifier for normally distributed data.
nativeObj| Modifier | Constructor and Description |
|---|---|
|
CvNormalBayesClassifier()
Default and training constructors.
|
protected |
CvNormalBayesClassifier(long addr) |
|
CvNormalBayesClassifier(Mat trainData,
Mat responses)
Default and training constructors.
|
|
CvNormalBayesClassifier(Mat trainData,
Mat responses,
Mat varIdx,
Mat sampleIdx)
Default and training constructors.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
protected void |
finalize() |
float |
predict(Mat samples)
Predicts the response for sample(s).
|
float |
predict(Mat samples,
Mat results)
Predicts the response for sample(s).
|
boolean |
train(Mat trainData,
Mat responses)
Trains the model.
|
boolean |
train(Mat trainData,
Mat responses,
Mat varIdx,
Mat sampleIdx,
boolean update)
Trains the model.
|
load, load, save, saveprotected CvNormalBayesClassifier(long addr)
public CvNormalBayesClassifier()
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
public CvNormalBayesClassifier(Mat trainData, Mat responses, Mat varIdx, Mat sampleIdx)
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
trainData - a trainDataresponses - a responsesvarIdx - a varIdxsampleIdx - a sampleIdxpublic CvNormalBayesClassifier(Mat trainData, Mat responses)
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
trainData - a trainDataresponses - a responsespublic void clear()
public float predict(Mat samples, Mat results)
Predicts the response for sample(s).
The method estimates the most probable classes for input vectors. Input
vectors (one or more) are stored as rows of the matrix samples.
In case of multiple input vectors, there should be one output vector
results. The predicted class for a single input vector is
returned by the method.
The function is parallelized with the TBB library.
samples - a samplesresults - a resultspublic float predict(Mat samples)
Predicts the response for sample(s).
The method estimates the most probable classes for input vectors. Input
vectors (one or more) are stored as rows of the matrix samples.
In case of multiple input vectors, there should be one output vector
results. The predicted class for a single input vector is
returned by the method.
The function is parallelized with the TBB library.
samples - a samplespublic boolean train(Mat trainData, Mat responses, Mat varIdx, Mat sampleIdx, boolean update)
Trains the model.
The method trains the Normal Bayes classifier. It follows the conventions of the generic "CvStatModel.train" approach with the following limitations:
CV_ROW_SAMPLE data layout is supported.
responses must be integer numbers, though the vector may have
the CV_32FC1 type.
trainData - a trainDataresponses - a responsesvarIdx - a varIdxsampleIdx - a sampleIdxupdate - Identifies whether the model should be trained from scratch
(update=false) or should be updated using the new training data
(update=true).public boolean train(Mat trainData, Mat responses)
Trains the model.
The method trains the Normal Bayes classifier. It follows the conventions of the generic "CvStatModel.train" approach with the following limitations:
CV_ROW_SAMPLE data layout is supported.
responses must be integer numbers, though the vector may have
the CV_32FC1 type.
trainData - a trainDataresponses - a responsesprotected void finalize()
throws Throwable
finalize in class CvStatModelThrowableCopyright © 2014. All rights reserved.