Skip to content

PHamacher/kMeansClustering.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kMeansClustering

Build Status Build Status Codecov Coveralls

Features

Perform the clustering algorithm k-means, which split a set of points into k clusters.

Examples

using kMeansClustering
  
mat = rand(3,100) # generate 100 3-dimensional points
r = mykmeansclustering(mat,4) # organize mat in k=4 clusters
r[1] -> centers

r[2] -> total cost

r[3] -> assignments

r[4] -> initial centers used (Forgy method)
using RDatasets, kMeansClustering, Plots
iris = dataset("datasets", "iris");
features = collect(Matrix(iris[:, 1:4])');
r = mykmeansclustering(features, 3); # split data into k=3 clusters
scatter(iris.PetalLength, iris.PetalWidth, marker_z=r[3],
        color=:lightrainbow, legend=false)

Screenshot (8)

About

Algorithm to perform k-means clustering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages