0
$\begingroup$

I am working on a clustering model with the kmeans() function in the package stats and I have a question about the output.

My data is a sample from several tech companies and AAPL._UP is a variable equal to "1" if apple was up on that particular day.

I ran a kmeans algorithm with a k=16 and it gave me some output. I can interpret most of it but I'm just not sure what I'm looking at here. Can some one let me know what these numbers mean?

There is a picture of what I am looking at picture

If it helps, here are the cluster assignments picture

$\endgroup$
  • 1
    $\begingroup$ k-means on binary data is always a bit random. You may be using a too large k, and expecting clustering to do some magic that it cannot do (also, you probably meant to use the transposed data?) $\endgroup$ – Anony-Mousse Apr 28 '15 at 6:36
  • 1
    $\begingroup$ To decide on which k to use, I tested k=2 to 30 and looked for when delta R^2 started to see only marginal improvements. Thanks about the transpose though...oops $\endgroup$ – Joel Sinofsky Apr 28 '15 at 14:32
0
$\begingroup$

It seems like the first cluster contains 11 days. Of these 11 days, Microsoft was up all 11 days. Oracle was up 10 of 11 days.

I think the 6th cluster contains 8? days. Of these 8 days, Apple was up all 8 days. Facebook was up 4 days and down 4 days.

$\endgroup$
0
$\begingroup$

The centroids you obtained or cluster means can be understood as the most predominant pattern for that cluster. For instance, for cluster 1 data points always have microsoft_up=1 and oracle_up=1, others features like facebook or apple are not as strong. One way to visualize your data so that you can understand it better is using a Heatmap (the heatmap bellow is not using your data, it's just an example), in that way you will be able to visually understand what each cluster centroid represents. Also, if you are not so sure about the number of clusters you used ( maybe they are more or less), you can measure the quality of the clustering using Dunn's index which measures how compact are the clusters obtained.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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