Update kMeans.md
This commit is contained in:
committed by
GitHub
parent
72740a1163
commit
1ee4c38c0f
@ -3,7 +3,7 @@ title: kMeans
|
|||||||
tags: algorithm,array,advanced
|
tags: algorithm,array,advanced
|
||||||
---
|
---
|
||||||
|
|
||||||
Groups the given data into `k` clusters using the k-means clustering algorithm.
|
Groups the given data into `k` clusters, using the [k-means clustering](https://en.wikipedia.org/wiki/K-means_clustering) algorithm.
|
||||||
|
|
||||||
- Use `Array.from()` and `Array.prototype.slice()` to initialize appropriate variables for the cluster `centroids`, `distances` and `classes`.
|
- Use `Array.from()` and `Array.prototype.slice()` to initialize appropriate variables for the cluster `centroids`, `distances` and `classes`.
|
||||||
- Use a `while` loop to repeat the assignment and update steps as long as there are changes in the previous iteration, as indicated by `itr`.
|
- Use a `while` loop to repeat the assignment and update steps as long as there are changes in the previous iteration, as indicated by `itr`.
|
||||||
|
|||||||
Reference in New Issue
Block a user