Skip to content

Commit

Permalink
Merge branch 'development' into fix-245
Browse files Browse the repository at this point in the history
  • Loading branch information
Mec-iS authored Jan 22, 2025
2 parents be270c4 + 3da433f commit 3ae00d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/naive_bayes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::linalg::basic::arrays::{Array1, Array2, ArrayView1};
use crate::numbers::basenum::Number;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::marker::PhantomData;
use std::{cmp::Ordering, marker::PhantomData};

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / check_features (ubuntu)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / check_features (ubuntu, --features serde)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, i686-unknown-linux-gnu)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, i686-unknown-linux-gnu)

unused import: `cmp::Ordering`

Check failure on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / lint

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / check_features (ubuntu, --features datasets)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-wasi)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-wasi)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-wasi)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (windows, i686-pc-windows-msvc)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (windows, i686-pc-windows-msvc)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, x86_64-unknown-linux-gnu)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, x86_64-unknown-linux-gnu)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, x86_64-unknown-linux-gnu)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (macos, aarch64-apple-darwin)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (macos, aarch64-apple-darwin)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (macos, aarch64-apple-darwin)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-unknown-unknown)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-unknown-unknown)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-unknown-unknown)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (ubuntu, wasm32-unknown-unknown)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (windows, x86_64-pc-windows-msvc)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (windows, x86_64-pc-windows-msvc)

unused import: `cmp::Ordering`

Check warning on line 43 in src/naive_bayes/mod.rs

View workflow job for this annotation

GitHub Actions / tests (windows, x86_64-pc-windows-msvc)

unused import: `cmp::Ordering`

/// Distribution used in the Naive Bayes classifier.
pub(crate) trait NBDistribution<X: Number, Y: Number>: Clone {
Expand Down Expand Up @@ -93,6 +93,7 @@ impl<TX: Number, TY: Number, X: Array2<TX>, Y: Array1<TY>, D: NBDistribution<TX,
/// Returns a vector of size N with class estimates.
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
let y_classes = self.distribution.classes();

if y_classes.is_empty() {
return Err(Failed::predict("Failed to predict, no classes available"));
}
Expand Down

0 comments on commit 3ae00d2

Please sign in to comment.