Commit ba4855c
authored
N clusters medoids fix (#129)
* Don't sample with replacement for random placement
You'll always have an inertia at least as good as not doing this; i.e.
picking distinct medoids only helps in the optimization.
* Add test to ensure n_clusters
It appears to only be the "random" initialization that has the bug, but
it's cheap to test all initializations + methods.
* The initial medoids changed for determinism
We're now sampling differently so the inital deterministic sample is
different. This updates the test to use the new deterministic medoids.1 parent 3876fbd commit ba4855c
2 files changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
51 | 69 | | |
52 | 70 | | |
53 | 71 | | |
| |||
113 | 131 | | |
114 | 132 | | |
115 | 133 | | |
116 | | - | |
| 134 | + | |
117 | 135 | | |
118 | 136 | | |
119 | 137 | | |
| |||
0 commit comments