Skip to content

Commit

Permalink
Modify the distance calculating function in DenStream (relating to an…
Browse files Browse the repository at this point in the history
… issued mentioned in #1468).
  • Loading branch information
hoanganhngo610 committed Dec 6, 2023
1 parent 3ea1918 commit 930fe02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions river/cluster/denstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ class DenStream(base.Clusterer):
... denstream.learn_one(x)
>>> denstream.predict_one({0: -1, 1: -2})
0
1
>>> denstream.predict_one({0: 5, 1: 4})
1
2
>>> denstream.predict_one({0: 1, 1: 1})
0
>>> denstream.n_clusters
2
3
"""

Expand Down Expand Up @@ -183,7 +183,7 @@ def centers(self):

@staticmethod
def _distance(point_a, point_b):
return math.sqrt(utils.math.minkowski_distance(point_a, point_b, 2))
return utils.math.minkowski_distance(point_a, point_b, 2)

def _get_closest_cluster_key(self, point, clusters):
min_distance = math.inf
Expand Down

0 comments on commit 930fe02

Please sign in to comment.