Okay to do k means clustering in Python, we can do something that is we need to import a K means from the SK learn cluster library here. So, we need to include this on here. And we can do clustering using something like this k means equal k means above cluster equal that say I pull around 11 k means equal k means dot v, s. And they both equal k means dot predict, as, I can also get a sense Try by using something like the K means dot cluster centers. So the same price will be something that is k. So I will bring x Okay I will print the labels so labels is cluster and printer sent choice Okay, I can run them cool yeah. Okay and craster Let me see. So again okay and crust us cool you haven't Random core gain okay.
So, they see x data set and this is the cluster so one to 11 Okay. So, let's say for this one, this one means the first row of first observation is in cluster number one, then this one is second observation or second roles in the cluster number nine. This one the observation or the roles in cluster number 912 roles in cluster nine, cluster one. So, this is x. So the first rule is around cluster wise opinion cluster nine. So, this is a K means clustering Okay, that are these are the centroids