14
$\begingroup$

I have a very basic question on clustering. After I have found k clusters with their centroids, how do I go about interpreting the classes of the data points that I have clustered (assigning meaningful class labels to each cluster). I am not talking about validation of the clusters found.

Can it be done given a small labelled set of data points, compute to which cluster these labelled points belong to and based on type and number of points each cluster receives, decide the label? This seems pretty obvious but I don't know how standard it is to assigns labels to clusters this way.

To be clear, I want to perform unsupervised clustering that doesn't use any labels to first find my clusters. Then having found the clusters, I want to assign meaningful class labels to the clusters based on the properties of a few example datapoints.

$\endgroup$
3
  • $\begingroup$ I'm not sure to understand your question: usually, any k-means algorithm should return information on class membership for each data point. Are you talking about actual data points or new observations? $\endgroup$
    – chl
    Commented Mar 5, 2013 at 22:19
  • $\begingroup$ @chi I suspect Riyaz is concerned about finding names with which to label the clusters and is talking about a priori naming some of the points and then using some algorithm which considers the preponderance of named points in the clusters to then name those clusters. $\endgroup$
    – Glen_b
    Commented Mar 5, 2013 at 22:34
  • 2
    $\begingroup$ @Riyaz, could we use the following analogy to Factor Analysis to understand your question? Often someone will factor analyze a set of variables to cluster them into groups of variables that seem to 'hang together', but then the analyst needs to think about the nature of the variables that make up each cluster to come up w/ a name for / way of thinking about what each cluster (factor) is. Is that essentially what you're getting at here? $\endgroup$ Commented Mar 5, 2013 at 23:19

3 Answers 3

5
$\begingroup$

Yes. What you propose is entirely standard and it is the way that standard k-means software works automatically. In the case of k-means you compute the euclidean distance between each observation (data point) and each cluster mean (centroid) and assign the observations to the most similar cluster. Then, the label of the cluster is determined by examining that average characteristics of the observations classified to the cluster relative to the averages of those relative to the other clusters.

$\endgroup$
0
3
$\begingroup$

If you look at the names in your kmeans object you will notice that there is a "cluster" object. This contains the class labels ordered the same as your input data. Here is a simple example that binds the cluster labels back to your data.

x <- data.frame(X=rnorm(100, sd=0.3), Y=rnorm(100, mean=1, sd=0.3))

k <- kmeans(x, 2) 
names(k)
x <- data.frame(x, K=k$cluster)

# You can also directly return the clusters
x <- data.frame(x, K=kmeans(x, 2)$cluster)
$\endgroup$
0
$\begingroup$

The labels to the cluster may be based on the class of majority samples within a cluster. But this is true only if the number of clusters is equal to number of classes.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.