0

I have a question after working with the results of the following question: Plotting a heatmap given a dendrogram and a distance matrix in R.

I have worked with the second answer, and I used the Mtcars dataset for it.

rd<-dist(mtcars)
rc<-hclust(rd)
cd<-dist(t(mtcars))
cc<-hclust(cd)

cutree(rc, k = 4) -> ctr  ## the cars are split in 4 groups
cutree(cc, k = 2) -> ctc ## The collums names are split in 2 groups

What I will do is now choose which car is a good car for me. I don't know how I can do it, but I think about I like this: I tell R what I expect from the column clusters and R tell me which options I still have.

I hope that some of you can help me a little bit. I also know that you can do it without clustering etc, but I will do in future the same on a big dataset, and then do I need clustering.

PsychometStats
  • 2,147
  • 1
  • 11
  • 27
AkE
  • 1
  • `hclust` is telling you which cars are similar to each other based on all of the variables you provided. If you want to use the clusters for decision making, you need to first establish the selection criteria (i.e. X gas mileage, Y size, Z transmission type), cluster based on the selection criteria and then find the cluster closest to your desired criteria – Dave2e Oct 04 '19 at 15:23
  • @DaveT thank you for your answer! Let me explain some more: I did clustering on features, so the features are clustered togehter. Now i wil say: This cluster is important, and another cluster must have low values. Because my own dataset is very large, i can't look trhough the data to choose the best one. So how ca i do it more automaticly. – AkE Oct 07 '19 at 07:10
  • Your question is still unclear. Until you can define the criteria on how to determine the "best one", it is not possible to make it automatic. I suggest doing more research and then asking a new question. – Dave2e Oct 09 '19 at 13:09
  • Oke, i will do more research. I have already read something about decision tree's and probably can i use that, but first i will do more research about that before i come with a new question. – AkE Oct 10 '19 at 15:07

0 Answers0