MCPcopy Create free account
hub / github.com/Raibows/MLinRust / new

Method new

src/model/kmeans.rs:24–82  ·  view source on GitHub ↗

build K-Means model with unsupervised learning k: number of clusters max_iter: max iterations p: decide the distance, parameter of minkowski distance default: 2, i.e., Euclidean distance init_clusters: you can give a init clusters default: it will random choose k clusters from the samples early_stop: decide the tolerance error of the distance between the last two iterations default: 1e-3 seed: see

(k: usize, max_iter: usize, p: Option<usize>, init_clusters: Option<Vec<Vec<f32>>>, early_stop: Option<f32>, seed: Option<usize>, features: &Vec<Vec<f32>>)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 6

minkowski_distanceFunction · 0.85
maxFunction · 0.85
choiceMethod · 0.80
lenMethod · 0.80
iter_mutMethod · 0.80
into_iterMethod · 0.80

Tested by

no test coverage detected