Type Definition opencv::types::PtrOfKNearest [−][src]
Implementations
Trait Implementations
Stores algorithm parameters in a file storage
simplified API for language bindings Stores algorithm parameters in a file storage Read more
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). Read more
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string. Read more
Default number of neighbors to use in predict method. Read more
Whether classification or regression model should be trained. Read more
%Algorithm type, one of KNearest::Types. Read more
fn find_nearest(
&self,
samples: &dyn ToInputArray,
k: i32,
results: &mut dyn ToOutputArray,
neighbor_responses: &mut dyn ToOutputArray,
dist: &mut dyn ToOutputArray
) -> Result<f32>
fn find_nearest(
&self,
samples: &dyn ToInputArray,
k: i32,
results: &mut dyn ToOutputArray,
neighbor_responses: &mut dyn ToOutputArray,
dist: &mut dyn ToOutputArray
) -> Result<f32>
Finds the neighbors and predicts responses for input vectors. Read more
Trains the statistical model Read more
fn train(
&mut self,
samples: &dyn ToInputArray,
layout: i32,
responses: &dyn ToInputArray
) -> Result<bool>
fn train(
&mut self,
samples: &dyn ToInputArray,
layout: i32,
responses: &dyn ToInputArray
) -> Result<bool>
Trains the statistical model Read more
Returns the number of variables in training samples
Returns true if the model is trained
Returns true if the model is classifier
fn calc_error(
&self,
data: &Ptr<dyn TrainData>,
test: bool,
resp: &mut dyn ToOutputArray
) -> Result<f32>
fn calc_error(
&self,
data: &Ptr<dyn TrainData>,
test: bool,
resp: &mut dyn ToOutputArray
) -> Result<f32>
Computes error on the training or test dataset Read more
fn predict(
&self,
samples: &dyn ToInputArray,
results: &mut dyn ToOutputArray,
flags: i32
) -> Result<f32>
fn predict(
&self,
samples: &dyn ToInputArray,
results: &mut dyn ToOutputArray,
flags: i32
) -> Result<f32>
Predicts response(s) for the provided sample(s) Read more