You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, this package is benchmarked against similar implementations in both Python, R, and Julia. All reproducible benchmarks can be found in [ParallelKMeans/extras](https://github.com/PyDataBlog/ParallelKMeans.jl/tree/master/extras) directory.
Copy file name to clipboardExpand all lines: docs/src/index.md
+37-19Lines changed: 37 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
## Motivation
4
4
5
-
It's actually a funny story that led to the development of this package.
6
-
What started off as a personal toy project trying to re-construct the K-Means algorithm in native Julia blew up after a heated discussion on the Julia Discourse forum when I asked for Julia optimization tips. Long story short, the Julia community is an amazing one! Andrey offered his help and together, we decided to push the speed limits of Julia with a parallel implementation of the most famous clustering algorithm. The initial results were mind blowing so we have decided to tidy up the implementation and share with the world as a maintained Julia package.
5
+
It's actually a funny story led to the development of this package.
6
+
What started off as a personal toy project trying to re-construct the K-Means algorithm in native Julia blew up after a heated discussion on the Julia Discourse forum when I asked for Julia optimization tips. Long story short, Julia community is an amazing one! Andrey offered his help and together, we decided to push the speed limits of Julia with a parallel implementation of the most famous clustering algorithm. The initial results were mind blowing so we have decided to tidy up the implementation and share with the world as a maintained Julia pacakge.
7
7
8
8
Say hello to `ParallelKMeans`!
9
9
@@ -24,6 +24,22 @@ As a result, it is useful in practice to restart it several times to get the cor
24
24
25
25
## Installation
26
26
27
+
If you are using Julia in the recommended [Juno IDE](https://junolab.org/), the number of threads is already set to the number of available CPU cores so multithreading enabled out of the box.
28
+
For other IDEs, multithreading must be exported in your environment before launching the Julia REPL in the command line.
29
+
30
+
*TIP*: One needs to navigate or point to the Julia executable file to be able to launch it in the command line.
31
+
Enable multi threading on Mac/Linux systems via;
32
+
33
+
```bash
34
+
export JULIA_NUM_THREADS=n # where n is the number of threads/cores
35
+
```
36
+
37
+
For Windows systems:
38
+
39
+
```bash
40
+
set JULIA_NUM_THREADS=n # where n is the number of threads/cores
41
+
```
42
+
27
43
You can grab the latest stable version of this package from Julia registries by simply running;
28
44
29
45
*NB:* Don't forget to invoke Julia's package manager with `]`
@@ -56,10 +72,10 @@ git checkout experimental
56
72
-[X] Implementation of [Hamerly implementation](https://www.researchgate.net/publication/220906984_Making_k-means_Even_Faster).
57
73
-[X] Interface for inclusion in Alan Turing Institute's [MLJModels](https://github.com/alan-turing-institute/MLJModels.jl#who-is-this-repo-for).
58
74
-[X] Full Implementation of Triangle inequality based on [Elkan - 2003 Using the Triangle Inequality to Accelerate K-Means"](https://www.aaai.org/Papers/ICML/2003/ICML03-022.pdf).
59
-
-[X] Implementation of [Yinyang K-Means: A Drop-In Replacement of the Classic K-Means
60
-
with Consistent Speedup](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ding15.pdf)
75
+
-[X] Implementation of [Yinyang K-Means: A Drop-In Replacement of the Classic K-Means with Consistent Speedup](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ding15.pdf)
61
76
-[ ] Implementation of [Geometric methods to accelerate k-means algorithm](http://cs.baylor.edu/~hamerly/papers/sdm2016_rysavy_hamerly.pdf).
62
77
-[ ] Support for other distance metrics supported by [Distances.jl](https://github.com/JuliaStats/Distances.jl#supported-distances).
78
+
-[ ] Support of MLJ Random generation hyperparameter.
63
79
-[ ] Native support for tabular data inputs outside of MLJModels' interface.
64
80
-[ ] Refactoring and finalizaiton of API desgin.
65
81
-[ ] GPU support.
@@ -101,12 +117,12 @@ r.iterations # number of elapsed iterations
101
117
r.converged # whether the procedure converged
102
118
```
103
119
104
-
### Supported KMeans algorithm variations
120
+
### Supported KMeans algorithm variations and recommended use cases
-[Lloyd()](https://cs.nyu.edu/~roweis/csc2515-2006/readings/lloyd57.pdf) - Default algorithm but only recommended for very small matrices (switch to `n_threads = 1` to avoid overhead).
123
+
-[Hamerly()](https://www.researchgate.net/publication/220906984_Making_k-means_Even_Faster) - Useful in most cases. If uncertain about your use case, try this!
124
+
-[Elkan()](https://www.aaai.org/Papers/ICML/2003/ICML03-022.pdf) - Recommended for high dimensional data.
125
+
-[Yinyang()](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ding15.pdf) - An excellent choice for most cases. Swiss blade for many use cases.
0 commit comments