0

I am trying to learn machine learning and I am stuck at some point in kmeans algorithm. I have two questions on kmeans.

  1. I have gone through many kmeans algorithm example and most of them stops as soon as the kmeans cluster plot is done in graph. but I want the final predicted column to find the complete answer. Can I know how can I get the corresponding data.

For example, if I have three clusters and I want to get the records for different clusters and want to assign some value for them in my predicted column. what should I do?

  1. when I am doing the plotting for cluster, I am using only two of the observations from my entire dataset. What happens when I have more observations in my dataset and there is a dependency on the columns and I want to make use of them as well. Do I need to create separate cluster plots for these and then start analysing them as well?
Maitree
  • 1
  • 1
  • Can you show us what code you've run (including some sample data), what it outputs, and what you're expecting? – BLT Apr 12 '17 at 16:02
  • Thank you for your response. I was trying to solve the titanic survival problem following a different algorithm and since I studies kmeans I was trying to apply the same on titanic problem. The code is quite big to fit in this comment.. I have written the code and have generated the kmeans cluster point . However, I am stuck after that. I am not getting a way to map the clusters to the input dataset.. – Maitree Apr 12 '17 at 16:48
  • okay.. while searching for the answer I had got the below thing in stackoverflow. But its in Python. I want to do the exact thing using R. [link] (http://stackoverflow.com/questions/38372188/how-to-add-k-means-predicted-clusters-in-a-column-to-a-dataframe-in-python) – Maitree Apr 12 '17 at 16:58
  • Then definitely go ahead and add in the code you've used so far, just like you see in that other python question. – BLT Apr 12 '17 at 18:32

0 Answers0