Commit ef9f544
authored
Handle more edge cases in HierarchicalKMeans (elastic#130622)
This commit handle the following cases:
1) When the number of centroids is one (and better checks when number of
centroids < number of vectors).
2) when number of maxIterations is equal to 0 (no sampling)
fixes elastic#1304971 parent f047f78 commit ef9f544
File tree
3 files changed
+12
-11
lines changed- server/src
- main/java/org/elasticsearch/index/codec/vectors/cluster
- test/java/org/elasticsearch/index/codec/vectors/cluster
3 files changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 581 | | |
585 | 582 | | |
586 | 583 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
332 | 333 | | |
333 | | - | |
| 334 | + | |
| 335 | + | |
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| |||
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
342 | | - | |
| 344 | + | |
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
| |||
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
352 | | - | |
| 354 | + | |
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
0 commit comments