Identifying the customer segments in wholesale customer data using k-means clustering

The k-means algorithm is perhaps the most popular and commonly-used clustering method from partitioning clustering type. Though we usually call the clustering algorithm k-means, multiple implementations of this algorithm exist, namely the MacQueen, Lloyd and Forgy, and Hartigan-Wong algorithms. It has been studied and found that the Hartigan-Wong algorithm performs better than the other two algorithms in most situations. K-means in R makes use of the Hartigan-Wong implementation by default.

The k-means algorithm requires the k-value to be passed as a parameter. The parameter indicates the number of clusters to be made with the input data. It is often a challenge ...

Get R Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.