k-nn classifier
This is a library for solving classification problems using the k-nearest neighbor (k-nn) algorithm. Due to the simplicity of the algorithm, it is lightweight and well-suited for easily solving classification problems.
Install
Simple Example
The following sample is a program that determines if a person is of normal weight or fat, based on their height(cm) and weight(kg).
use KnnClassifier;
Support CSV format
The classifier can be converted to and from CSV format.
// Convert Data to CSV
let s = clf.to_csv;
println!;
// Convert from CSV
clf.from_csv;
// Predict one
let label = clf.predict_one;
assert_eq!;