Skip to content

Commit cb1e2f9

Browse files
fmt
1 parent d2e1907 commit cb1e2f9

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

src/machine_learning/naive_bayes.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ fn gaussian_log_pdf(x: f64, mean: f64, variance: f64) -> f64 {
7474
log_coefficient + exponent_term
7575
}
7676

77-
7877
pub fn train_naive_bayes(training_data: Vec<(Vec<f64>, f64)>) -> Option<Vec<ClassStatistics>> {
7978
if training_data.is_empty() {
8079
return None;
@@ -122,7 +121,6 @@ pub fn train_naive_bayes(training_data: Vec<(Vec<f64>, f64)>) -> Option<Vec<Clas
122121
Some(class_stats)
123122
}
124123

125-
126124
pub fn predict_naive_bayes(model: &[ClassStatistics], test_point: &[f64]) -> Option<f64> {
127125
if model.is_empty() || test_point.is_empty() {
128126
return None;
@@ -158,7 +156,6 @@ pub fn predict_naive_bayes(model: &[ClassStatistics], test_point: &[f64]) -> Opt
158156
best_class
159157
}
160158

161-
162159
pub fn naive_bayes(training_data: Vec<(Vec<f64>, f64)>, test_point: Vec<f64>) -> Option<f64> {
163160
let model = train_naive_bayes(training_data)?;
164161
predict_naive_bayes(&model, &test_point)

0 commit comments

Comments
 (0)