Skip to content

Update README.md #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# skmeans

Super fast simple k-means and [k-means++](https://en.wikipedia.org/wiki/K-means%2B%2B) implementation for unidimiensional and multidimensional data. Works on nodejs and browser.
Superfast simple k-means and [k-means++](https://en.wikipedia.org/wiki/K-means%2B%2B) implementation for unidimensional and multidimensional data. Works on nodejs and browser.

## Installation
```
Expand Down Expand Up @@ -46,13 +46,13 @@ var res = skmeans(data,3);

## API
### skmeans(data,k,[centroids],[iterations])
Calculates unidimiensional and multidimensional k-means clustering on *data*. Parameters are:
* **data** Unidimiensional or multidimensional array of values to be clustered. for unidimiensional data, takes the form of a simple array *[1,2,3.....,n]*. For multidimensional data, takes a
Calculates unidimensional and multidimensional k-means clustering on *data*. Parameters are:
* **data** Unidimensional or multidimensional array of values to be clustered. For unidimensional data, takes the form of a simple array *[1,2,3.....,n]*. For multidimensional data, takes a
NxM array *[[1,2],[2,3]....[n,m]]*
* **k** Number of clusters
* **centroids** Optional. Initial centroid values. If not provided, the algorith will try to choose an apropiate ones. Alternative values can be:
* **"kmrand"** Cluster initialization will be random, but with extra checking, so there will no be two equal initial centroids.
* **"kmpp"** The algorythm will use the [k-means++](https://en.wikipedia.org/wiki/K-means%2B%2B) cluster initialization method.
* **centroids** Optional. Initial centroid values. If not provided, the algorithm will try to choose appropriate ones. Alternative values can be:
* **"kmrand"** Cluster initialization will be random, but with extra checking, so there will not be two equal initial centroids.
* **"kmpp"** The algorithm will use the [k-means++](https://en.wikipedia.org/wiki/K-means%2B%2B) cluster initialization method.
* **iterations** Optional. Maximum number of iterations. If not provided, it will be set to 10000.
* **distance function** Optional. Custom distance function. Takes two points as arguments and returns a scalar number.

Expand Down