Params

Struct Params 

Source
pub struct Params(pub cuvsKMeansParams_t);

Tuple Fields§

§0: cuvsKMeansParams_t

Implementations§

Source§

impl Params

Source

pub fn new() -> Result<Params>

Returns a new Params

Source

pub fn set_metric(self, metric: DistanceType) -> Params

DistanceType to use for fitting kmeans

Source

pub fn set_n_clusters(self, n_clusters: i32) -> Params

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

Source

pub fn set_max_iter(self, max_iter: i32) -> Params

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

Source

pub fn set_tol(self, tol: f64) -> Params

Relative tolerance with regards to inertia to declare convergence.

Source

pub fn set_n_init(self, n_init: i32) -> Params

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

Source

pub fn set_oversampling_factor(self, oversampling_factor: f64) -> Params

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

Source

pub fn set_batch_samples(self, batch_samples: i32) -> Params

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.

Source

pub fn set_batch_centroids(self, batch_centroids: i32) -> Params

if 0 then batch_centroids = n_clusters

Source

pub fn set_hierarchical(self, hierarchical: bool) -> Params

Whether to use hierarchical (balanced) kmeans or not

Source

pub fn set_hierarchical_n_iters(self, hierarchical_n_iters: i32) -> Params

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

Trait Implementations§

Source§

impl Debug for Params

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for Params

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Params

§

impl RefUnwindSafe for Params

§

impl !Send for Params

§

impl !Sync for Params

§

impl Unpin for Params

§

impl UnwindSafe for Params

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> 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, 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.