@@ -54,8 +54,8 @@ class TimeSeriesKMeans(BaseClusterer):
54
54
n_timepoints)
55
55
and contains the time series to use as centroids.
56
56
distance : str or Callable, default='msm'
57
- Distance metric to compute similarity between time series. A list of valid
58
- strings for metrics can be found in the documentation for
57
+ Distance measure to compute similarity between time series. A list of valid
58
+ strings for measures can be found in the documentation for
59
59
:func:`aeon.distances.get_distance_function`. If a callable is passed it must be
60
60
a function that takes two 2d numpy arrays as input and returns a float.
61
61
n_init : int, default=10
@@ -236,7 +236,7 @@ def _fit_one_init(self, X: np.ndarray) -> tuple:
236
236
prev_labels = None
237
237
for i in range (self .max_iter ):
238
238
curr_pw = pairwise_distance (
239
- X , cluster_centres , metric = self .distance , ** self ._distance_params
239
+ X , cluster_centres , measure = self .distance , ** self ._distance_params
240
240
)
241
241
curr_labels = curr_pw .argmin (axis = 1 )
242
242
curr_inertia = curr_pw .min (axis = 1 ).sum ()
@@ -273,13 +273,13 @@ def _fit_one_init(self, X: np.ndarray) -> tuple:
273
273
def _predict (self , X : np .ndarray , y = None ) -> np .ndarray :
274
274
if isinstance (self .distance , str ):
275
275
pairwise_matrix = pairwise_distance (
276
- X , self .cluster_centers_ , metric = self .distance , ** self ._distance_params
276
+ X , self .cluster_centers_ , measure = self .distance , ** self ._distance_params
277
277
)
278
278
else :
279
279
pairwise_matrix = pairwise_distance (
280
280
X ,
281
281
self .cluster_centers_ ,
282
- metric = self .distance ,
282
+ measure = self .distance ,
283
283
** self ._distance_params ,
284
284
)
285
285
return pairwise_matrix .argmin (axis = 1 )
@@ -346,7 +346,7 @@ def _kmeans_plus_plus_center_initializer(self, X: np.ndarray):
346
346
347
347
for _ in range (1 , self .n_clusters ):
348
348
pw_dist = pairwise_distance (
349
- X , X [indexes ], metric = self .distance , ** self ._distance_params
349
+ X , X [indexes ], measure = self .distance , ** self ._distance_params
350
350
)
351
351
min_distances = pw_dist .min (axis = 1 )
352
352
probabilities = min_distances / min_distances .sum ()
@@ -381,7 +381,7 @@ def _handle_empty_cluster(
381
381
index_furthest_from_centre = curr_pw .min (axis = 1 ).argmax ()
382
382
cluster_centres [current_empty_cluster_index ] = X [index_furthest_from_centre ]
383
383
curr_pw = pairwise_distance (
384
- X , cluster_centres , metric = self .distance , ** self ._distance_params
384
+ X , cluster_centres , measure = self .distance , ** self ._distance_params
385
385
)
386
386
curr_labels = curr_pw .argmin (axis = 1 )
387
387
curr_inertia = curr_pw .min (axis = 1 ).sum ()
0 commit comments