Class cv::ml::NormalBayesClassifier#
Bayes classifier for normally distributed data. View details
#include <opencv2/ml.hpp>Collaboration diagram for cv::ml::NormalBayesClassifier:
Public Types#
Public Types inherited from cv::ml::StatModel
Return |
Name |
Description |
|---|---|---|
Public Member Functions#
Public Member Functions inherited from cv::ml::StatModel
Return |
Name |
Description |
|---|---|---|
|
|
Computes error on the training or test dataset. |
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Returns the number of variables in training samples. |
|
|
Returns true if the model is classifier. |
|
|
Returns true if the model is trained. |
|
|
|
Predicts response(s) for the provided sample(s) |
|
Trains the statistical model. |
|
|
|
Trains the statistical model. |
Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Clears the algorithm state. |
|
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Reads algorithm parameters from a file storage. |
|
|
||
|
|
|
|
Stores algorithm parameters in a file storage. |
|
|
Static Public Member Functions#
Static Public Member Functions inherited from cv::ml::StatModel
Return |
Name |
Description |
|---|---|---|
|
Create and train model with default parameters. |
Static Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
|
Loads algorithm from the file. |
|
|
Loads algorithm from a String. |
|
Reads algorithm from the file node. |
Additional Inherited Members#
Protected Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
Bayes classifier for normally distributed data.
See also
ml_intro_bayes
Member Function Documentation#
predictProb()#
float cv::ml::NormalBayesClassifier::predictProb(
InputArray inputs,
OutputArray outputs,
OutputArray outputProbs,
int flags = 0 )
Python:
cv.ml.NormalBayesClassifier.predictProb(inputs[, outputs[, outputProbs[, flags]]]) -> retval, outputs, outputProbs
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 inputs. In case of multiple input vectors, there should be one output vector outputs. The predicted class for a single input vector is returned by the method. The vector outputProbs contains the output probabilities corresponding to each element of result.
create()#
static Ptr< NormalBayesClassifier > cv::ml::NormalBayesClassifier::create()
Python:
cv.ml.NormalBayesClassifier.create() -> retval
cv.ml.NormalBayesClassifier_create() -> retval
Creates empty model Use StatModel::train to train the model after creation.
load()#
static Ptr< NormalBayesClassifier > cv::ml::NormalBayesClassifier::load(
const String & filepath,
const String & nodeName = String() )
Python:
cv.ml.NormalBayesClassifier.load(filepath[, nodeName]) -> retval
cv.ml.NormalBayesClassifier_load(filepath[, nodeName]) -> retval
Loads and creates a serialized NormalBayesClassifier from a file.
Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk. Load the NormalBayesClassifier from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
Parameters
filepath— path to serialized NormalBayesClassifiernodeName— name of node containing the classifier
Source file#
The documentation for this class was generated from the following file:
opencv2/ml.hpp