Commit b9c4fce
committed
Implement adaptive batch size and early stopping in MiniBatch k-means
* Make `MiniBatch` struct mutable
* Add adaptive batch size mechanism based on convergence rate
* Introduce early stopping criteria by monitoring change in cluster assignments
* Improve initialization of centroids using k-means++ or other heuristic methods
* Replace `copy` with zero allocations in the `kmeans!` function
* Add tests for adaptive batch size mechanism
* Add tests for early stopping criteria
* Add tests for improved initialization of centroids1 parent 500f7a6 commit b9c4fce
2 files changed
+45
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
118 | 139 | | |
119 | 140 | | |
120 | 141 | | |
| |||
150 | 171 | | |
151 | 172 | | |
152 | 173 | | |
153 | | - | |
| 174 | + | |
154 | 175 | | |
155 | 176 | | |
156 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
55 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
56 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
57 | 78 | | |
58 | | - | |
59 | | - | |
| 79 | + | |
0 commit comments