K-MEANS CLUSTERING
The K means algorithm takes the input parameter K from the user and partitions the dataset containing N objects into K clusters so that resulting similarity among the data objects inside the group (intracluster) is high but the similarity of data objects with the data objects from outside the cluster is low (intercluster). The similarity of the cluster is determined with respect to the mean value of the cluster.
It is a type of square error algorithm. At the start randomly k objects from the dataset are chosen in which each of the objects represents a cluster mean. For the rest of the data objects, they are assigned to the nearest cluster based on their distance from the cluster mean. The new mean of each of the cluster is then calculated with the added data objects.
Method:
1. Randomly assign K objects from the dataset(D) as cluster centers(C)
2.Reassign each object to which object is most similar based upon mean values.
3.Update Cluster means, i.e., Recalculate the mean of each cluster with the updated values.
4. Repeat Step 4 until no change occurs.
K-means clustering algorithm works efficiently only for numerical dataset. It cannot give proper results for the categorical data because of the improper spatial representation. K-Means Clustering fails to find patterns in the categorical dataset.