pub struct KMeansConfig {
pub k: usize,
pub max_iterations: usize,
pub convergence_threshold: f32,
pub seed: Option<u64>,
}Expand description
Configuration for k-means clustering.
Fields§
§k: usizeNumber of clusters (centroids).
max_iterations: usizeMaximum number of iterations.
convergence_threshold: f32Convergence threshold (stop if centroid movement < threshold).
seed: Option<u64>Random seed for reproducibility.
Implementations§
Source§impl KMeansConfig
impl KMeansConfig
Sourcepub const fn with_max_iterations(self, iterations: usize) -> Self
pub const fn with_max_iterations(self, iterations: usize) -> Self
Set the maximum number of iterations.
Sourcepub const fn with_convergence_threshold(self, threshold: f32) -> Self
pub const fn with_convergence_threshold(self, threshold: f32) -> Self
Set the convergence threshold.
Trait Implementations§
Source§impl Clone for KMeansConfig
impl Clone for KMeansConfig
Source§fn clone(&self) -> KMeansConfig
fn clone(&self) -> KMeansConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KMeansConfig
impl Debug for KMeansConfig
Auto Trait Implementations§
impl Freeze for KMeansConfig
impl RefUnwindSafe for KMeansConfig
impl Send for KMeansConfig
impl Sync for KMeansConfig
impl Unpin for KMeansConfig
impl UnwindSafe for KMeansConfig
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