-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bernoulli naive bayes implementation #242
base: master
Are you sure you want to change the base?
Conversation
not sure which dependency causes this issue |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #242 +/- ##
==========================================
- Coverage 55.59% 55.57% -0.02%
==========================================
Files 96 98 +2
Lines 8951 9042 +91
==========================================
+ Hits 4976 5025 +49
- Misses 3975 4017 +42 ☔ View full report in Codecov by Sentry. |
Seems like we need to bump MSRV to 1.59 (or limit the |
let thr = self.binarize.unwrap_or_else(F::zero); | ||
let xbin = x.map(|v| if v > &thr { F::one() } else { F::zero() }); | ||
if self.binarize.is_some() { | ||
CowArray::from(xbin) | ||
} else { | ||
CowArray::from(x) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write the logic like:
if let Some(thr) = self.binarize {
...
} else {
...
}
// Threshold for binarization | ||
binarize: Option<F>, | ||
// Phantom data for label type | ||
label: PhantomData<L>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this phantomdata?
Continuation of #226