Gpushift dev - #1
Conversation
boykovdn
commented
Feb 17, 2021
- Basic clustering step
- sklearn-like interface
imagirom
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR Boyko! I've added some minor comments, it would be great if you could have a look before merging :)
|
|
||
| def predict(self, X): | ||
| r""" | ||
| Predict cluster belonging based on which cluster center is the closest. |
| # spherical = self._get_distance_metric('spherical') | ||
| # | ||
| # composite = lambda x,y : euclidean(x,y)**2 + spherical(x,y) | ||
| # |
There was a problem hiding this comment.
If this block is no longer needed (as you have implemented it differently above), I would prefer to delete it. Same for the other commented blocks above.
|
|
||
| self.cluster_centers_ = None | ||
|
|
||
| self.meanshift_step = MeanShiftStep(bandwidth=bandwidth, kernel=kernel, use_keops=use_keops) |
There was a problem hiding this comment.
Was it your intention to not pass the distance metric here? I thought not only the final clustering but also every MS step should use the chosen metric.
| :param distance_metric: callable or None | ||
| If None, uses standard Euclidean distances. For special applications, | ||
| the passing of a custom distance function is allowed. |
There was a problem hiding this comment.
I think it would be good to add the required signature of distance metric if it is a callable, including the shapes of the input tensors, to the docstring.
|
Reminder to also add an example using the new interface (I will do that) |