Enum linfa_clustering::KMeansError
source · pub enum KMeansError {
InvalidParams(KMeansParamsError),
InertiaError,
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
LinfaError(Error)
Trait Implementations§
source§impl Debug for KMeansError
impl Debug for KMeansError
source§impl Display for KMeansError
impl Display for KMeansError
source§impl Error for KMeansError
impl Error for KMeansError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§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>
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>
source§fn 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>
source§impl From<Error> for KMeansError
impl From<Error> for KMeansError
source§impl From<KMeansError> for GmmError
impl From<KMeansError> for GmmError
source§fn from(source: KMeansError) -> Self
fn from(source: KMeansError) -> Self
Converts to this type from the input type.
source§impl From<KMeansParamsError> for KMeansError
impl From<KMeansParamsError> for KMeansError
source§fn 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§
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