Enum linfa_bayes::BayesError [−][src]
pub enum BayesError { Stats(MinMaxError), BaseCrate(Error), }
An error when using a GaussianNB classifier
Variants
Stats(MinMaxError)
Error when performing Max operation on data
BaseCrate(Error)
Trait Implementations
impl Error for BayesError
[src]
impl Error for BayesError
[src]impl<F, D, L> Fit<ArrayBase<D, Dim<[usize; 2]>>, L, BayesError> for GaussianNbParams where
F: Float,
D: Data<Elem = F>,
L: AsTargets<Elem = usize> + Labels<Elem = usize>,
[src]
impl<F, D, L> Fit<ArrayBase<D, Dim<[usize; 2]>>, L, BayesError> for GaussianNbParams where
F: Float,
D: Data<Elem = F>,
L: AsTargets<Elem = usize> + Labels<Elem = usize>,
[src]type Object = GaussianNb<F>
fn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, L>
) -> Result<Self::Object>
[src]
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, L>
) -> Result<Self::Object>
Fit the model
Example
let x = array![ [-2., -1.], [-1., -1.], [-1., -2.], [1., 1.], [1., 2.], [2., 1.] ]; let y = array![1, 1, 1, 2, 2, 2]; let data = Dataset::new(x, y); let model = GaussianNbParams::params().fit(&data)?; let pred = model.predict(&data); assert_abs_diff_eq!(pred, data.try_single_target()?);
impl From<MinMaxError> for BayesError
[src]
impl From<MinMaxError> for BayesError
[src]fn from(source: MinMaxError) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for BayesError
impl RefUnwindSafe for BayesError
impl Send for BayesError
impl Send for BayesError
impl Sync for BayesError
impl Sync for BayesError
impl Unpin for BayesError
impl Unpin for BayesError
impl UnwindSafe for BayesError
impl UnwindSafe for BayesError