Skip to content

Commit 396a1d3

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5a5f69f commit 396a1d3

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

machine_learning/mean_shift.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ def get_points_within_bandwidth(
6666
>>> get_points_within_bandwidth(data, [0.0, 0.0], 10.0)
6767
[[0.0, 0.0], [0.5, 0.5], [5.0, 5.0]]
6868
"""
69-
return [
70-
point for point in data if euclidean_distance(point, center) <= bandwidth
71-
]
69+
return [point for point in data if euclidean_distance(point, center) <= bandwidth]
7270

7371

7472
def compute_mean(points: list[list[float]]) -> list[float]:
@@ -144,8 +142,7 @@ def merge_centroids(
144142
merged: list[list[float]] = []
145143
for centroid in centroids:
146144
if all(
147-
euclidean_distance(centroid, existing) >= bandwidth
148-
for existing in merged
145+
euclidean_distance(centroid, existing) >= bandwidth for existing in merged
149146
):
150147
merged.append(centroid)
151148
return merged

0 commit comments

Comments
 (0)