Skip to content

ml_NormalBayesClassifier

mlclassOpenCV 5.0.0
import { ml_NormalBayesClassifier } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSml_NormalBayesClassifier
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits ml_StatModel.


Normal Bayes Classifier * *************************************************************************************** Bayes classifier for normally distributed data.

See: ml_intro_bayes

Constructors and members

static create

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

create(): ml_NormalBayesClassifier | null;
Returns

The ml_NormalBayesClassifier | null result.

static load

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

load(filepath: EmbindString, nodeName: EmbindString): ml_NormalBayesClassifier | null;
2 available overloads
load(filepath: EmbindString): ml_NormalBayesClassifier | null;
load(filepath: EmbindString, nodeName: EmbindString): ml_NormalBayesClassifier | null;
filepath

path to serialized NormalBayesClassifier

nodeName

name of node containing the classifier

Returns

The ml_NormalBayesClassifier | null result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

predictProb

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.
predictProb(inputs: Mat, outputs: Mat, outputProbs: Mat, flags: number): number;
2 available overloads
predictProb(inputs: Mat, outputs: Mat, outputProbs: Mat): number;
predictProb(inputs: Mat, outputs: Mat, outputProbs: Mat, flags: number): number;
inputs

inputs argument (Mat).

outputs

Output destination, filled by the native operation. outputs argument (Mat).

outputProbs

Output destination, filled by the native operation. output probs argument (Mat).

flags

flags argument (number).

Returns

The number result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.