I am trying to find a clustering algorithm, but I'm working with already classified items.
Basically, items belongs to one or more category, which are already known. Categories are absolutely not linked each other. I need to create clusters where the number of distinct categories among all items is minimum. The same category could be splitted in several clusters.
Cluster count and cluster size are known at the beginning.
| Item | Category | | ------ | -------- | | Item 1 | C1, C2 | | Item 2 | C1 | cluster count = 2 | Item 3 | C2 | cluster size = 3 | Item 4 | C2 | | Item 5 | C3 | | Item 6 | C1 | Result: - Cluster 1: [Item 1, Item 3, Item 4] // 2 categories (C1, C2) - Cluster 2: [Item 2, Item 5, Item 6] // 2 categories (C1, C3)
I have already tried custom k-means implementation, but it seems to produce results far from optimal. Am I missing something? Does a well-known algorithm correspond to this kind of problem?
EDIT let's explain a bit more
I need to classify items based on the only attribute I know: their category belonging. I have used a custom distance function, which can be expressed as:
d(I1, I2) = number of category that I1 and I2 do not have in common
I have only tried to use random starting point, and it gives me different results, but far from optimal.