pappacena

pappacena / kmeans / 0.2.0

README.md

Overview

Provides an easy implementation of k-means grouping algorithm

With this algorithm, you can send a JSON dataset and it will return, for each line in the dataset, the cluster of the most similar lines.

Usage

Input

_The input for this algorithm should be a JSON with the number of clusters to group and the dataset itself. For example: _

{
	"n": 3,
	"dataset": [
		[1, 2, 3],
		[3, 3, 3],
		[9, 9, 9],
		[9, 2, 1],
		[5, 6, 9]
	]
}

Output

The API will output a JSON list with the cluster index of each line given:

[2, 2, 1, 0, 1]