[][src]Trait opencv::ml::NormalBayesClassifier

pub trait NormalBayesClassifier: StatModel {
    fn as_raw_NormalBayesClassifier(&self) -> *mut c_void;

    fn predict_prob(
        &self,
        inputs: &dyn ToInputArray,
        outputs: &mut dyn ToOutputArray,
        output_probs: &mut dyn ToOutputArray,
        flags: i32
    ) -> Result<f32> { ... } }

Bayes classifier for normally distributed data.

See also

@ref ml_intro_bayes

Required methods

Loading content...

Provided methods

fn predict_prob(
    &self,
    inputs: &dyn ToInputArray,
    outputs: &mut dyn ToOutputArray,
    output_probs: &mut dyn ToOutputArray,
    flags: i32
) -> Result<f32>

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.

C++ default parameters

  • flags: 0
Loading content...

Methods

impl<'_> dyn NormalBayesClassifier + '_[src]

pub fn create() -> Result<PtrOfNormalBayesClassifier>[src]

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

pub fn load(
    filepath: &str,
    node_name: &str
) -> Result<PtrOfNormalBayesClassifier>
[src]

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 NormalBayesClassifier
  • nodeName: name of node containing the classifier

C++ default parameters

  • node_name: String()

Implementors

Loading content...