k-means clustering

The purpose of k-means clustering is to partition n observations into k clusters, where each observation belongs to the cluster with the nearest mean. This results in a partitioning of the data space into a Voronoi diagram. In mathematics, a Voronoi diagram is a partitioning of a plane into regions based on the distance to points in a specific subset of the plane.

Borrowed from Priyadarsini (https://www.kaggle.com/maitree/kmeans-unsupervised-learning-using-wine-dataset/data), the slightly modified code is given here:

library(readr) library(corrplot) library(ggplot2) # path<-"http://canisius.edu/~yany/RData/wine.RData" load(url(path)) red2<-red red2$quality<-NULL white2<-white white2$quality<-NULL red_cor<-cor(red2) white_cor<-cor(white2) ...

Get Hands-On Data Science with Anaconda 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.