This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is a pure Python3 implementation of the K-means Clustering algorithm. | |
It is based on a GitHub Gist which uses Python2: | |
https://gist.github.com/iandanforth/5862470 | |
I have refactored the code and to assure the code obeys Python Enhancement Proposals (PEPs) rules. | |
After reading through this code you should understand clearly how K-means works. | |
This script specifically avoids using numpy or other more obscure libraries. | |
It is meant to be *clear* not fast. | |
I have also added integration with the plot.ly plotting library. | |
So you can see the clusters found by this algorithm. To install plotly run: |
NewerOlder