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
Copy file name to clipboardExpand all lines: docs/src/index.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,21 @@
2
2
3
3
## Motivation
4
4
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 optimizaition 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.
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.
7
7
8
8
Say hello to `ParallelKMeans`!
9
9
10
-
This package aims to utilize the speed of Julia and parallelization (both CPU & GPU) to offer an extremely fast implementation of the K-Means clustering algorithm and its variations via a friendly interface for practioners.
10
+
This package aims to utilize the speed of Julia and parallelization (both CPU & GPU) to offer an extremely fast implementation of the K-Means clustering algorithm and its variants via a friendly interface for practioners.
11
11
12
-
In short, we hope this package will eventually mature as the "onestop" shop for everything K-Means on both CPUs and GPUs.
12
+
In short, we hope this package will eventually mature as the "one-stop-shop" for everything K-Means on CPUs and GPUs.
13
13
14
14
## K-Means Algorithm Implementation Notes
15
15
16
-
Since Julia is a column major language, the input (design matrix) expected by the package in the following format;
16
+
Since Julia is a column major language, the input (design matrix) expected by the package must be in the following format;
17
17
18
18
- Design matrix X of size n×m, the i-th column of X `(X[:, i])` is a single data point in n-dimensional space.
19
-
- Thus, the rows of the design design matrix represents the feature space with the columns representing all the training examples in this feature space.
19
+
- Thus, the rows of the design matrix represent the feature space with the columns representing all the training samples in this feature space.
20
20
21
21
One of the pitfalls of K-Means algorithm is that it can fall into a local minima.
22
22
This implementation inherits this problem like every implementation does.
@@ -26,28 +26,28 @@ As a result, it is useful in practice to restart it several times to get the cor
26
26
27
27
You can grab the latest stable version of this package from Julia registries by simply running;
28
28
29
-
*NB:* Don't forget to Julia's package manager with `]`
29
+
*NB:* Don't forget to invoke Julia's package manager with `]`
30
30
31
31
```julia
32
32
pkg> add ParallelKMeans
33
33
```
34
34
35
-
For the few (and selected) brave ones, one can simply grab the current experimental features by simply adding the experimental branch to your development environment after invoking the package manager with `]`:
35
+
The few (and selected) brave ones can simply grab the current experimental features by simply adding the experimental branch to your development environment after invoking the package manager with `]`:
36
36
37
37
```julia
38
38
dev git@github.com:PyDataBlog/ParallelKMeans.jl.git
39
39
```
40
40
41
-
Don't forget to checkout the experimental branch and you are good to go with bleeding edge features and breaks!
41
+
Don't forget to checkout the experimental branch and you are good to go with bleeding edge features and breakages!
42
42
43
43
```bash
44
44
git checkout experimental
45
45
```
46
46
47
47
## Features
48
48
49
-
-Lightening fast implementation of Kmeans clustering algorithm even on a single thread in native Julia.
50
-
- Support for multi-theading implementation of K-Means clustering algorithm.
49
+
-Lightning fast implementation of Kmeans clustering algorithm even on a single thread in native Julia.
50
+
- Support for multi-threading implementation of K-Means clustering algorithm.
51
51
- 'Kmeans++' initialization for faster and better convergence.
52
52
- Implementation of available classic and contemporary variants of the K-Means algorithm.
53
53
@@ -68,7 +68,7 @@ git checkout experimental
68
68
69
69
## How To Use
70
70
71
-
Taking advantage of Julia's brilliant multiple dispatch system, the package exposes users to a very easy to use API.
71
+
Taking advantage of Julia's brilliant multiple dispatch system, the package exposes users to a very easy-to-use API.
72
72
73
73
```julia
74
74
using ParallelKMeans
@@ -90,7 +90,7 @@ r = kmeans(Lloyd(), X, 3) # same result as the default
90
90
```
91
91
92
92
```julia
93
-
# r contains all the learned artifacts which can be accessed as;
93
+
# r contains all the learned artifacts that can be accessed as;
# various artificats can be accessed from the result ie assigned labels, cost value etc
124
+
# various artifacts can be accessed from the result i.e. assigned labels, cost value etc
125
125
result =kmeans(features, 3);
126
126
127
127
# plot with the point color mapped to the assigned cluster index
@@ -140,14 +140,14 @@ using ParallelKMeans
140
140
# Single Thread Implementation of Lloyd's Algorithm
141
141
b = [ParallelKMeans.kmeans(X, i, n_threads=1; tol=1e-6, max_iters=300, verbose=false).totalcost for i =2:10]
142
142
143
-
# Multi Thread Implementation of Lloyd's Algorithm by default
143
+
# Multi-threaded Implementation of Lloyd's Algorithm by default
144
144
c = [ParallelKMeans.kmeans(X, i; tol=1e-6, max_iters=300, verbose=false).totalcost for i =2:10]
145
145
146
146
```
147
147
148
148
## Benchmarks
149
149
150
-
Currently, this package is benchmarked against similar implementation in both Python and Julia. All reproducible benchmarks can be found in [ParallelKMeans/extras](https://github.com/PyDataBlog/ParallelKMeans.jl/tree/master/extras) directory. More tests in various languages are planned beyond the initial release version (`0.1.0`).
150
+
Currently, this package is benchmarked against similar implementations in both Python and Julia. All reproducible benchmarks can be found in [ParallelKMeans/extras](https://github.com/PyDataBlog/ParallelKMeans.jl/tree/master/extras) directory. More tests in various languages are planned beyond the initial release version (`0.1.0`).
151
151
152
152
*Note*: All benchmark tests are made on the same computer to help eliminate any bias.
Ultimately, we see this package as potentially the onestopshop for everything related to KMeans algorithm and its speed up variants. We are open to new implementations and ideas from anyone interested in this project.
182
+
Ultimately, we see this package as potentially the one-stop-shop for everything related to KMeans algorithm and its speed up variants. We are open to new implementations and ideas from anyone interested in this project.
183
183
184
184
Detailed contribution guidelines will be added in upcoming releases.
0 commit comments