Skip to main content
100%

Untitled

✓ Published0🌍 Public
Ssz2036
Last edited Jan 31, 2023
Created on Jan 31, 2023
Forked from Pseudo Bar Chart

This interactive example demonstrates the k-means clustering algorithm on a one-dimensional dataset of ten random points. Users click an "Iteration Step" button to advance the algorithm, which reassigns each point to its nearest centroid and recalculates centroid positions. The visualization uses D3 v7 with an SVG rendering, where points are colored by cluster assignment (blue, green, orange) and larger gray-stroked circles represent centroids. The code employs d3.scaleLinear to map data values to x-coordinates, and point assignment uses absolute distance calculations to update cluster memberships.

AI-generated description

clustering

MIT Licensed

Similar vizzes