@@ -278,7 +278,7 @@ def __init__(
278
278
eps = 0 ,
279
279
p = 2 ,
280
280
random_seed = 42 ,
281
- ref_index = None ,
281
+ ref_index = 0 ,
282
282
fun_dist = None ,
283
283
):
284
284
"""
@@ -312,13 +312,13 @@ def __init__(
312
312
Seed for random selection of points be evaluated.
313
313
ref_index: int, list, optional
314
314
Index of the reference sample to start the selection algorithm from.
315
- It can be an integer, or a list of integers or None. When None, the medoid center is chosen as the reference
316
- sample.
317
- When the `ref_index` is a list for multiple classes, it will be shared among all clusters.
318
- If we want to use different reference indices for each class, we can perform the subset
319
- selection for each class separately where different `ref_index` parameters can be used.
320
- For example, if we have two classes, we can pass `ref_index=[0, 1 ]` to select samples
321
- from class 0 and `ref_index=[3, 6]` class 1 respectively .
315
+ It can be an integer, or a list of integers.
316
+ When the `ref_index` is a list for multiple classes, it will be shared among all
317
+ clusters. If we want to use different reference indices for each class, we can perform
318
+ the subset selection for each class separately where different `ref_index` parameters
319
+ can be used. For example, if we have two classes, we can pass `ref_index=[0, 1]` to
320
+ select samples from class 0 and `ref_index=[3, 6 ]` class 1 respectively.
321
+ Default is [0] .
322
322
fun_dist : callable, optional
323
323
Function for calculating the pairwise distance between sample points to be used in
324
324
calculating the medoid. `fun_dist(x) -> x_dist` takes a 2D feature array of shape
@@ -354,7 +354,7 @@ def algorithm(self, x, max_size) -> Union[List, Iterable]:
354
354
"""
355
355
# set up reference index
356
356
selected = get_initial_selection (x = x , x_dist = None , ref_index = self .ref_index , fun_dist = None )
357
- count = 1
357
+ count = len ( selected )
358
358
359
359
# establish a kd-tree for nearest-neighbor lookup
360
360
tree = spatial .KDTree (x )
@@ -475,9 +475,10 @@ def __init__(self, r0=None, ref_index=None, tol=0.05, n_iter=10, p=2.0, eps=0.0,
475
475
Initial guess for radius of the exclusion sphere.
476
476
ref_index: int, list, optional
477
477
Index of the reference sample to start the selection algorithm from.
478
- It can be an integer, or a list of integers or None. When None, the medoid center is chosen as the reference
479
- sample.
480
- When the `ref_index` is a list for multiple classes, it will be shared among all clusters.
478
+ It can be an integer, or a list of integers or None. When None, the medoid center is
479
+ chosen as the reference sample.
480
+ When the `ref_index` is a list for multiple classes,
481
+ it will be shared among all clusters.
481
482
If we want to use different reference indices for each class, we can perform the subset
482
483
selection for each class separately where different `ref_index` parameters can be used.
483
484
For example, if we have two classes, we can pass `ref_index=[0, 1]` to select samples
0 commit comments