K-means clustering of wine data
This visualization demonstrates the results of K-means clustering on the wine dataset, plotting each sample as a dot based on its Alcohol and Malic attributes, with colors indicating cluster membership. The code uses D3.js v3 to render an SVG scatterplot, employing d3.scale.linear for axes, d3.svg.axis for tick marks, and d3.scale.category20 for coloring clusters. Mouseover events trigger a tooltip showing cluster, Alcohol, and Malic values. Data comes from the clusters.csv file, which includes precomputed cluster assignments.
AI-generated descriptionI wrote a blog post for packtpub describing the K-means clustering procedure. The codes I provided were written in R, I also pointed to another blog post of mine where I use python to explain this algotithm. I decided to write a D3 visualization of the clusters.