Skip to content

Conversation

@azad96
Copy link

@azad96 azad96 commented Feb 14, 2024

get_class_ind() function is supposed to return class indices, but '/' operator does float division in python3.6 while it does integer divison in python2.7. As a result, we can get class indices such as 9.75, which creates a bug in the code. For example, we have the below line at line 171.

sq_dists[self.get_class_ind(seed_cluster) == self.cluster_classes] = np.inf

When the left-hand side of == does not return a whole number in python3.6, none of the values in self.cluster_classes are equal to that value. This behaviour is fixed by changing '/' to '//' since '//' does integer division in both python versions.

…oat in python3.6, which makes the return values of the function different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant