OpenCV 2.4.3 (RC)

org.opencv.ml
Class CvNormalBayesClassifier

java.lang.Object
  extended by org.opencv.ml.CvStatModel
      extended by org.opencv.ml.CvNormalBayesClassifier

public class CvNormalBayesClassifier
extends CvStatModel

Bayes classifier for normally distributed data.

See Also:
org.opencv.ml.CvNormalBayesClassifier : public CvStatModel

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

CvNormalBayesClassifier

public CvNormalBayesClassifier()

Default and training constructors.

The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.

See Also:
org.opencv.ml.CvNormalBayesClassifier.CvNormalBayesClassifier

CvNormalBayesClassifier

protected CvNormalBayesClassifier(long addr)

CvNormalBayesClassifier

public CvNormalBayesClassifier(Mat trainData,
                               Mat responses)

Default and training constructors.

The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.

Parameters:
trainData - a trainData
responses - a responses
See Also:
org.opencv.ml.CvNormalBayesClassifier.CvNormalBayesClassifier

CvNormalBayesClassifier

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.

Parameters:
trainData - a trainData
responses - a responses
varIdx - a varIdx
sampleIdx - a sampleIdx
See Also:
org.opencv.ml.CvNormalBayesClassifier.CvNormalBayesClassifier
Method Detail

clear

public void clear()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class CvStatModel
Throws:
java.lang.Throwable

predict

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.

Parameters:
samples - a samples
See Also:
org.opencv.ml.CvNormalBayesClassifier.predict

predict

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.

Parameters:
samples - a samples
results - a results
See Also:
org.opencv.ml.CvNormalBayesClassifier.predict

train

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:

Parameters:
trainData - a trainData
responses - a responses
See Also:
org.opencv.ml.CvNormalBayesClassifier.train

train

public 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:

Parameters:
trainData - a trainData
responses - a responses
varIdx - a varIdx
sampleIdx - a sampleIdx
update - Identifies whether the model should be trained from scratch (update=false) or should be updated using the new training data (update=true).
See Also:
org.opencv.ml.CvNormalBayesClassifier.train

Official OpenCV 2.4 Documentation