Skip to content

Commit

Permalink
Remove math.sqrt from the distance calculating function within DBSTRE…
Browse files Browse the repository at this point in the history
…AM (resolve partially issue #1468).
  • Loading branch information
hoanganhngo610 committed Dec 5, 2023
1 parent b19b9ca commit b93a169
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion river/cluster/dbstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(

@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)

This comment has been minimized.

Copy link
@MaxHalford

MaxHalford Dec 5, 2023

Member

Hey @hoanganhngo610. I understand the change, but it seems to have broken some unit tests. Could you take a look? :)

This comment has been minimized.

Copy link
@hoanganhngo610

hoanganhngo610 Dec 6, 2023

Author Contributor

Thank you @MaxHalford! I just also noticed this, and I think the best solution would be to modify the unit tests accordingly. Sorry for not noticing this earlier.

This comment has been minimized.

Copy link
@ShkarupaDC

ShkarupaDC Dec 6, 2023

Hi! I found the same bug in the Silhouette metric implementation (link). Could you please check the entire codebase for this bug?

This comment has been minimized.

Copy link
@hoanganhngo610

hoanganhngo610 Dec 6, 2023

Author Contributor

@ShkarupaDC Thank you very much for pointing this out! I will check the whole repository to see if there is any other errors remaining.

This comment has been minimized.

Copy link
@hoanganhngo610

hoanganhngo610 Dec 6, 2023

Author Contributor

@ShkarupaDC I have just made all the changes to the bugs appeared within the repo relating to this error in my two latest commits, one relating the Silhouette metric and one relating to DenStream. If you find anything remains, please do not hesitate to let me know.
@MaxHalford I think that I will not be making any changes to the tests of DBSTREAM until I can resolve all the points raised by @ShkarupaDC in issue #1468.


def _find_fixed_radius_nn(self, x):
fixed_radius_nn = {}
Expand Down

0 comments on commit b93a169

Please sign in to comment.