ml_NormalBayesClassifier
import { ml_NormalBayesClassifier } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;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;filepathpath to serialized NormalBayesClassifier
nodeNamename of node containing the classifier
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;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;inputsinputs argument (Mat).
outputsOutput destination, filled by the native operation. outputs argument (Mat).
outputProbsOutput destination, filled by the native operation. output probs argument (Mat).
flagsflags argument (number).
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.