Skip to content

Visualization of the k-means clustering algorithm. The algorithm was being used to find a k-color palette that was representative of an input image.

Notifications You must be signed in to change notification settings

allengu01/kmeans-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k-Means Visualizer

This program uses the k-means clustering algorithm to determine k colors that are representative of a provided image. In this application, each dataset consists of the pixel values for that image. The visualization for the algorithm is made from 3D scatter plots with Matplotlib.

What is k-means clustering?

K-means clustering is an unsupervised machine learning algorithm that finds k clusters within a given dataset. The algorithm begins by defining k centroids, around which each cluster will be created. A cluster of a centroid is defined as all members of the dataset (in this case, pixels RGB values) which are closest to that given centroid. Next, when all members of the data set are assigned to the closest centroid, the algorithm moves each centroid to the mean of the cluster. The algorithm continues to iterate by creating clusters and updating the centroids until no centroids move during an iteration.

Examples

1) Image Link (k = 4)


2) Starry Night (k = 3)

About

Visualization of the k-means clustering algorithm. The algorithm was being used to find a k-color palette that was representative of an input image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages