[−][src]Struct smartcore::naive_bayes::multinomial::MultinomialNB
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]
x: &M,
y: &M::RowVector,
parameters: MultinomialNBParameters<T>
) -> Result<Self, Failed>
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]
T: Deserialize<'de>,
M: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: PartialEq + RealNumber, M: PartialEq + Matrix<T>> PartialEq<MultinomialNB<T, M>> for MultinomialNB<T, M>
[src]
pub fn eq(&self, other: &MultinomialNB<T, M>) -> bool
[src]
pub fn ne(&self, other: &MultinomialNB<T, M>) -> bool
[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]
T: Serialize,
M: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for MultinomialNB<T, M> where
M: Send,
T: Send,
[src]
M: Send,
T: Send,
impl<T, M> Sync for MultinomialNB<T, M> where
M: Sync,
T: Sync,
[src]
M: Sync,
T: Sync,
impl<T, M> Unpin for MultinomialNB<T, M> where
M: Unpin,
T: Unpin,
[src]
M: Unpin,
T: Unpin,
impl<T, M> UnwindSafe for MultinomialNB<T, M> where
M: UnwindSafe,
T: UnwindSafe,
[src]
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,