pub struct MultinomialNaiveBayes { /* private fields */ }Implementations§
Source§impl MultinomialNaiveBayes
impl MultinomialNaiveBayes
pub fn new(config: NaiveBayesConfig) -> MultinomialNaiveBayes
pub fn to_json(&self) -> String
pub fn from_json(raw: &str) -> Option<MultinomialNaiveBayes>
Trait Implementations§
Source§impl Clone for MultinomialNaiveBayes
impl Clone for MultinomialNaiveBayes
Source§fn clone(&self) -> MultinomialNaiveBayes
fn clone(&self) -> MultinomialNaiveBayes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultinomialNaiveBayes
impl Debug for MultinomialNaiveBayes
Source§impl IncrementalClassifier for MultinomialNaiveBayes
impl IncrementalClassifier for MultinomialNaiveBayes
Source§fn fit(&mut self, examples: &[TrainingExample])
fn fit(&mut self, examples: &[TrainingExample])
Train from scratch. Any previous weights are discarded.
Source§fn partial_fit(&mut self, examples: &[TrainingExample])
fn partial_fit(&mut self, examples: &[TrainingExample])
Incrementally update with a mini-batch. Previous weights are
preserved; this is the online-learning entrypoint.
Source§fn predict(&self, features: &[f32]) -> Option<u32>
fn predict(&self, features: &[f32]) -> Option<u32>
Predict the most likely class for one example.
Source§fn predict_proba(&self, features: &[f32]) -> Vec<f32>
fn predict_proba(&self, features: &[f32]) -> Vec<f32>
Predict a probability per class (0..num_classes).
Source§fn num_classes(&self) -> usize
fn num_classes(&self) -> usize
Number of distinct classes seen so far.
Source§fn num_features(&self) -> usize
fn num_features(&self) -> usize
Number of features the model expects. 0 until
fit/
partial_fit has been called with at least one example.Source§fn samples_seen(&self) -> u64
fn samples_seen(&self) -> u64
Total number of training examples the model has seen over
its lifetime — incremented by both
fit (reset to N) and
partial_fit (additive). Useful for lineage + rate-limiting.Auto Trait Implementations§
impl Freeze for MultinomialNaiveBayes
impl RefUnwindSafe for MultinomialNaiveBayes
impl Send for MultinomialNaiveBayes
impl Sync for MultinomialNaiveBayes
impl Unpin for MultinomialNaiveBayes
impl UnsafeUnpin for MultinomialNaiveBayes
impl UnwindSafe for MultinomialNaiveBayes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request