Skip to main content

cuvsKMeansParams

Struct cuvsKMeansParams 

Source
#[repr(C)]
pub struct cuvsKMeansParams {
Show 13 fields pub metric: cuvsDistanceType, pub n_clusters: c_int, pub init: cuvsKMeansInitMethod, pub max_iter: c_int, pub tol: f64, pub n_init: c_int, pub oversampling_factor: f64, pub batch_samples: c_int, pub batch_centroids: c_int, pub inertia_check: bool, pub hierarchical: bool, pub hierarchical_n_iters: c_int, pub streaming_batch_size: i64,
}
Expand description

@brief Hyper-parameters for the kmeans algorithm

Fields§

§metric: cuvsDistanceType§n_clusters: c_int

The number of clusters to form as well as the number of centroids to generate (default:8).

§init: cuvsKMeansInitMethod

Method for initialization, defaults to k-means++:

  • cuvsKMeansInitMethod::KMeansPlusPlus (k-means++): Use scalable k-means++ algorithm to select the initial cluster centers.
  • cuvsKMeansInitMethod::Random (random): Choose ‘n_clusters’ observations (rows) at random from the input data for the initial centroids.
  • cuvsKMeansInitMethod::Array (ndarray): Use ‘centroids’ as initial cluster centers.
§max_iter: c_int

Maximum number of iterations of the k-means algorithm for a single run.

§tol: f64

Relative tolerance with regards to inertia to declare convergence.

§n_init: c_int

Number of instance k-means algorithm will be run with different seeds.

§oversampling_factor: f64

Oversampling factor for use in the k-means|| algorithm

§batch_samples: c_int

batch_samples and batch_centroids are used to tile 1NN computation which is useful to optimize/control the memory footprint Default tile is [batch_samples x n_clusters] i.e. when batch_centroids is 0 then don’t tile the centroids

§batch_centroids: c_int

if 0 then batch_centroids = n_clusters

§inertia_check: bool

Check inertia during iterations for early convergence.

§hierarchical: bool

Whether to use hierarchical (balanced) kmeans or not

§hierarchical_n_iters: c_int

For hierarchical k-means , defines the number of training iterations

§streaming_batch_size: i64

Number of samples to process per GPU batch for the batched (host-data) API. When set to 0, defaults to n_samples (process all at once).

Trait Implementations§

Source§

impl Clone for cuvsKMeansParams

Source§

fn clone(&self) -> cuvsKMeansParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for cuvsKMeansParams

Source§

impl Debug for cuvsKMeansParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.