[][src]Struct smartcore::naive_bayes::multinomial::MultinomialNB

pub struct MultinomialNB<T: RealNumber, M: Matrix<T>> { /* fields omitted */ }

MultinomialNB implements the categorical naive Bayes algorithm for categorically distributed data.

Implementations

impl<T: RealNumber, M: Matrix<T>> MultinomialNB<T, M>[src]

pub fn fit(
    x: &M,
    y: &M::RowVector,
    parameters: MultinomialNBParameters<T>
) -> Result<Self, Failed>
[src]

Fits MultinomialNB with given data

  • x - training data of size NxM where N is the number of samples and M is the number of features.
  • y - vector with target values (classes) of length N.
  • parameters - additional parameters like class priors, alpha for smoothing and binarizing threshold.

pub fn predict(&self, x: &M) -> Result<M::RowVector, Failed>[src]

Estimates the class labels for the provided data.

  • x - data of shape NxM where N is number of data points to estimate and M is number of features. Returns a vector of size N with class estimates.

Trait Implementations

impl<T: Debug + RealNumber, M: Debug + Matrix<T>> Debug for MultinomialNB<T, M>[src]

impl<'de, T: RealNumber, M: Matrix<T>> Deserialize<'de> for MultinomialNB<T, M> where
    T: Deserialize<'de>,
    M: Deserialize<'de>, 
[src]

impl<T: PartialEq + RealNumber, M: PartialEq + Matrix<T>> PartialEq<MultinomialNB<T, M>> for MultinomialNB<T, M>[src]

impl<T: RealNumber, M: Matrix<T>> Predictor<M, <M as BaseMatrix<T>>::RowVector> for MultinomialNB<T, M>[src]

impl<T: RealNumber, M: Matrix<T>> Serialize for MultinomialNB<T, M> where
    T: Serialize,
    M: Serialize
[src]

impl<T: RealNumber, M: Matrix<T>> StructuralPartialEq for MultinomialNB<T, M>[src]

impl<T: RealNumber, M: Matrix<T>> SupervisedEstimator<M, <M as BaseMatrix<T>>::RowVector, MultinomialNBParameters<T>> for MultinomialNB<T, M>[src]

Auto Trait Implementations

impl<T, M> RefUnwindSafe for MultinomialNB<T, M> where
    M: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, M> Send for MultinomialNB<T, M> where
    M: Send,
    T: Send
[src]

impl<T, M> Sync for MultinomialNB<T, M> where
    M: Sync,
    T: Sync
[src]

impl<T, M> Unpin for MultinomialNB<T, M> where
    M: Unpin,
    T: Unpin
[src]

impl<T, M> UnwindSafe for MultinomialNB<T, M> where
    M: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,