|
OpenCV 2.4.3 (RC) | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opencv.ml.CvStatModel org.opencv.ml.CvNormalBayesClassifier
public class CvNormalBayesClassifier
Bayes classifier for normally distributed data.
Field Summary |
---|
Fields inherited from class org.opencv.ml.CvStatModel |
---|
nativeObj |
Constructor Summary | |
---|---|
|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.opencv.ml.CvStatModel |
---|
load, load, save, save |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CvNormalBayesClassifier()
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
protected CvNormalBayesClassifier(long addr)
public 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 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 sampleIdxMethod Detail |
---|
public void clear()
protected void finalize() throws java.lang.Throwable
finalize
in class CvStatModel
java.lang.Throwable
public 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 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 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 responsespublic 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
).
|
Official OpenCV 2.4 Documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |