@@ -18,7 +18,7 @@ from ..metrics import euclidean_distances
1818from ._k_means import _centers_dense
1919
2020
21- cdef floating euclidian_dist (floating* a, floating* b, int n_features) nogil:
21+ cdef floating euclidean_dist (floating* a, floating* b, int n_features) nogil:
2222 cdef floating result, tmp
2323 result = 0
2424 cdef int i
@@ -89,12 +89,12 @@ cdef update_labels_distances_inplace(
8989 # assign first cluster center
9090 c_x = 0
9191 x = X + sample * n_features
92- d_c = euclidian_dist (x, centers, n_features)
92+ d_c = euclidean_dist (x, centers, n_features)
9393 lower_bounds[sample, 0 ] = d_c
9494 for j in range (1 , n_clusters):
9595 if d_c > center_half_distances[c_x, j]:
9696 c = centers + j * n_features
97- dist = euclidian_dist (x, c, n_features)
97+ dist = euclidean_dist (x, c, n_features)
9898 lower_bounds[sample, j] = dist
9999 if dist < d_c:
100100 d_c = dist
@@ -197,7 +197,7 @@ def k_means_elkan(np.ndarray[floating, ndim=2, mode='c'] X_, int n_clusters,
197197 # Recompute the upper bound by calculating the actual distance
198198 # between the sample and label.
199199 if not bounds_tight[point_index]:
200- upper_bound = euclidian_dist (x_p, centers_p + label * n_features, n_features)
200+ upper_bound = euclidean_dist (x_p, centers_p + label * n_features, n_features)
201201 lower_bounds[point_index, label] = upper_bound
202202 bounds_tight[point_index] = 1
203203
@@ -206,7 +206,7 @@ def k_means_elkan(np.ndarray[floating, ndim=2, mode='c'] X_, int n_clusters,
206206 # distance, reassign labels.
207207 if (upper_bound > lower_bounds[point_index, center_index]
208208 or (upper_bound > center_half_distances[label, center_index])):
209- distance = euclidian_dist (x_p, centers_p + center_index * n_features, n_features)
209+ distance = euclidean_dist (x_p, centers_p + center_index * n_features, n_features)
210210 lower_bounds[point_index, center_index] = distance
211211 if distance < upper_bound:
212212 label = center_index
0 commit comments