feat: + builders for algorithm parameters

This commit is contained in:
Volodymyr Orlov
2020-12-23 12:29:39 -08:00
parent 74f0d9e6fb
commit dd341f4a12
17 changed files with 276 additions and 8 deletions
+6
View File
@@ -234,7 +234,13 @@ impl<T: RealNumber> CategoricalNBParameters<T> {
)))
}
}
/// Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).
pub fn with_alpha(mut self, alpha: T) -> Self {
self.alpha = alpha;
self
}
}
impl<T: RealNumber> Default for CategoricalNBParameters<T> {
fn default() -> Self {
Self { alpha: T::one() }