make default params available to serde (#167)

* add seed param to search params

* make default params available to serde

* lints

* create defaults for enums

* lint
This commit is contained in:
Montana Low
2022-09-21 19:48:31 -07:00
committed by morenol
parent 05dfffad5c
commit f4fd4d2239
22 changed files with 175 additions and 18 deletions
+6
View File
@@ -58,6 +58,12 @@ pub enum KNNWeightFunction {
Distance,
}
impl Default for KNNWeightFunction {
fn default() -> Self {
KNNWeightFunction::Uniform
}
}
impl KNNWeightFunction {
fn calc_weights<T: RealNumber>(&self, distances: Vec<T>) -> std::vec::Vec<T> {
match *self {