Python Forum

Full Version: K means clustering using heatmap
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,
So in another post I asked how to get a heat map working. Well I was able to get the heat map to work. But I've ran into another problem regarding k means clustering.
I have a beginner dataset which is https://raw.githubusercontent.com/gsprin...simple.csv
and a final dataset which is

https://raw.githubusercontent.com/gsprin...cancer.csv

and I need to use k means clustering to group it. I know for k means clustering I need to pick centers, and then compute the euclidean distance between the center and each point and then group them. I was wondering how I would go about doing this and finding the distance since the data is not in a (x,y) coordinate format.

If my question doesn't make sense, visually I need to transform a heatmap that looks like

https://camo.githubusercontent.com/7476c...702e706e67
into

https://camo.githubusercontent.com/6018d...642e706e67
by using 2 means clustering
My major problem is that I don't understand how to k means clustering works for heatmaps such how to calculate the distance and reassign the points, if someone could explain this it would be most helpful.

Any tips on how I can go about doing this?
Thanks for reading