Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Untitled

Public visualization

Viewing a saved revision (read-only)

5ecd5e4adddb4633a55835ce6fa4b634

Untitled

0 stars0🌍 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