Skip to content

Basic implementation of sequential k-means clustering algorithm

Notifications You must be signed in to change notification settings

kostrahb/kmeans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K-means

This module is an implementation of sequential k-means clustering algorithm as presented in Princeton university materials

If you have some batch data and expect some more on the fly, this is algorithm just for you.

Usage

	k := kmeans.New(5, kmeans.CanberraDistance, 0.1)

	// Seed gets initial clusters from batch of data
	k.Seed(batch)

	// Add adds new point to clusters, remembering all the previous data
	k.Add(o)

	// Alternatively you can use Addf which "forgets" old data. It uses second approach
	// and constant alpha (0.1) passed during creation of k to update cluster centers.
	k.Addf(o)

	// You can access clusters like this:
	for _, c := range k.C {
		// some code...
	}

About

Basic implementation of sequential k-means clustering algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages