New answers tagged

1 vote

TypeError: unhashable type: 'slice' K-Means; Custom code for K-Means

The self.Centroids attribute starts by being a numpy array, which you can you index by row and column. However, later on, you overwrite ...
Oxbowerce's user avatar
  • 7,307
0 votes

K means clustering of image with k=1 vs mean of all pixels

Yes - if you are taking k-means with k=1, it's the same as calculating the mean of all pixels in the image. Attention to the channels though - you should be taking the means of all pixels per channel, ...
brewmaster321's user avatar
2 votes

Enhance clustering with evaluation function

It seems to me that you are facing a metric learning problem. Here is a survey on the topic: https://people.bu.edu/bkulis/pubs/ftml_metric_learning.pdf In particular, the scikit-learn library for ...
gabalz's user avatar
  • 156
0 votes
Accepted

Kernel Kmeans formula

It was a bit difficult, but I think I have found a way to implement this formula. Hope this answer will help those struggling with the implementation of Kernel Kmeans algorithm. Here is a working ...
app_idea54's user avatar
1 vote

Kernel Kmeans formula

Let's break down the formula for your chosen linear kernel with dot product $K(x_n, \mu_k)=x_n \cdot \mu_k$. In your case you seem to try to compute the sum of kernel functions for the first point $...
cinch's user avatar
  • 148
0 votes
Accepted

Kernel Kmeans implementation

I didn't hear you say K-medioids. Constraining (x, y) coordinates to match an observed point would be helpful, if you're not already doing that for the last two examples. I am struck by the symmetry ...
J_H's user avatar
  • 802

Top 50 recent answers are included