pub struct KNNClassifier<S: KNearestSearch> { /* private fields */ }
Expand description

k-Nearest Neighbor Classifier

Implementations

Constructs an untrained KNN Classifier with specified number of search neighbors.

Examples
use rusty_machine::learning::knn::KNNClassifier;
let _ = KNNClassifier::new(3);

Constructs an untrained KNN Classifier with specified k and leafsize for KDTree.

Examples
use rusty_machine::learning::knn::{KNNClassifier, BallTree};
let _ = KNNClassifier::new_specified(3, BallTree::new(10));

Trait Implementations

Formats the value using the given formatter. Read more

Constructs an untrained KNN Classifier with searching 5 neighbors.

Examples
use rusty_machine::learning::knn::KNNClassifier;
let _ = KNNClassifier::default();
Predict output from inputs.
Train the model using inputs and targets.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.