opencv::prelude

Trait KNearestTrait

Source
pub trait KNearestTrait: KNearestTraitConst + StatModelTrait {
    // Required method
    fn as_raw_mut_KNearest(&mut self) -> *mut c_void;

    // Provided methods
    fn set_default_k(&mut self, val: i32) -> Result<()> { ... }
    fn set_is_classifier(&mut self, val: bool) -> Result<()> { ... }
    fn set_emax(&mut self, val: i32) -> Result<()> { ... }
    fn set_algorithm_type(&mut self, val: i32) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::ml::KNearest

Required Methods§

Provided Methods§

Source

fn set_default_k(&mut self, val: i32) -> Result<()>

Default number of neighbors to use in predict method.

§See also

setDefaultK getDefaultK

Source

fn set_is_classifier(&mut self, val: bool) -> Result<()>

Whether classification or regression model should be trained.

§See also

setIsClassifier getIsClassifier

Source

fn set_emax(&mut self, val: i32) -> Result<()>

Parameter for KDTree implementation.

§See also

setEmax getEmax

Source

fn set_algorithm_type(&mut self, val: i32) -> Result<()>

%Algorithm type, one of KNearest::Types.

§See also

setAlgorithmType getAlgorithmType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§