Enum linfa_clustering::KMeansError
source · [−]pub enum KMeansError {
InvalidParams(KMeansParamsError),
InertiaError,
NotConverged,
LinfaError(Error),
}
Expand description
An error when modeling a KMeans algorithm
Variants
InvalidParams(KMeansParamsError)
When any of the hyperparameters are set the wrong value
InertiaError
When inertia computation fails
NotConverged
When fitting algorithm does not converge
LinfaError(Error)
Trait Implementations
sourceimpl Debug for KMeansError
impl Debug for KMeansError
sourceimpl Display for KMeansError
impl Display for KMeansError
sourceimpl Error for KMeansError
impl Error for KMeansError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<F: Float, R: Rng + Clone, DA: Data<Elem = F>, T, D: Distance<F>> Fit<ArrayBase<DA, Dim<[usize; 2]>>, T, KMeansError> for KMeansValidParams<F, R, D>
impl<F: Float, R: Rng + Clone, DA: Data<Elem = F>, T, D: Distance<F>> Fit<ArrayBase<DA, Dim<[usize; 2]>>, T, KMeansError> for KMeansValidParams<F, R, D>
sourcefn fit(
&self,
dataset: &DatasetBase<ArrayBase<DA, Ix2>, T>
) -> Result<Self::Object, KMeansError>
fn fit(
&self,
dataset: &DatasetBase<ArrayBase<DA, Ix2>, T>
) -> Result<Self::Object, KMeansError>
Given an input matrix observations
, with shape (n_observations, n_features)
,
fit
identifies n_clusters
centroids based on the training data distribution.
An instance of KMeans
is returned.
type Object = KMeans<F, D>
sourceimpl From<Error> for KMeansError
impl From<Error> for KMeansError
sourceimpl From<KMeansError> for GmmError
impl From<KMeansError> for GmmError
sourcefn from(source: KMeansError) -> Self
fn from(source: KMeansError) -> Self
Converts to this type from the input type.
sourceimpl From<KMeansParamsError> for KMeansError
impl From<KMeansParamsError> for KMeansError
sourcefn from(source: KMeansParamsError) -> Self
fn from(source: KMeansParamsError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for KMeansError
impl Send for KMeansError
impl Sync for KMeansError
impl Unpin for KMeansError
impl UnwindSafe for KMeansError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more