Table of Contents

Class NormalBayesClassifier

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

Bayes classifier for normally distributed data

public class NormalBayesClassifier : StatModel, IDisposable, ICvPtrHolder
Inheritance
NormalBayesClassifier
Implements
Inherited Members

Constructors

NormalBayesClassifier(nint)

Creates instance by raw pointer cv::ml::NormalBayesClassifier*

protected NormalBayesClassifier(nint p)

Parameters

p nint

Methods

Create()

Creates empty model. Use StatModel::train to train the model after creation.

public static NormalBayesClassifier Create()

Returns

NormalBayesClassifier

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()

Load(string)

Loads and creates a serialized model from a file.

public static NormalBayesClassifier Load(string filePath)

Parameters

filePath string

Returns

NormalBayesClassifier

LoadFromString(string)

Loads algorithm from a String.

public static NormalBayesClassifier LoadFromString(string strModel)

Parameters

strModel string

he string variable containing the model you want to load.

Returns

NormalBayesClassifier

PredictProb(InputArray, OutputArray, OutputArray, int)

Predicts the response for sample(s).

public float PredictProb(InputArray inputs, OutputArray outputs, OutputArray outputProbs, int flags = 0)

Parameters

inputs InputArray
outputs OutputArray
outputProbs OutputArray
flags int

Returns

float

Remarks

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.