Hiroki
Hiroki

Reputation: 4183

Implement k-medoids algorithm by supplying the distances between data objects and the medoids

I've been trying to implement k-medoids in C++. So far, I've come up with implementing k-medoids by supplying the number of clusters (or the number of seeds), as described in Wikipedia's k-medoids page.

Now, what I'm trying to do is to implement it by supplying the distances, instead of the number of clusters.

Let me draw a picture. The two circles represent a cluster and dots are data objects. C1 and C2 are the seeds (medoids).

For example, if you supply "8 miles", each green line in the picture above has to be equal or lower than 8 miles. I've spent a lot of time in searching how to implement k-medoids by indicating the number seeds, but not the distances.

I'd appreciate if you'd give any advice. (I said I'm using c++, but the programming language itself doesn't matter, since I'm concerned about the algorithm only.)

Upvotes: 0

Views: 1675

Answers (1)

Has QUIT--Anony-Mousse
Has QUIT--Anony-Mousse

Reputation: 77505

If you limit the maximum distance, you are doing hierarchical clustering (more precisely, a single cut through the cluster tree), not k-medoids.

It's common to do this with a distance matrix, too.

Upvotes: 1

Related Questions