⚕️ Medical Data Analysis: Patient Risk Clustering (2D)
A 2D companion to the 3D scatter: plot simulated patient records on a biomarker-vs-symptom plane and watch the same live k-means pass sort them into risk bands, read straight off the plot instead of an orbiting scene.
This 2D companion runs the identical k-means loop as the 3D version — Euclidean assignment then centroid averaging — but plots patients on a flat biomarker-vs-symptom plane, so the clustering accuracy, inertia and centroid-drift readouts can be read directly off the chart instead of an orbiting point cloud.
Simulated patient records are scattered on a 2D feature plane and grouped live by k-means: each point joins its nearest centroid, centroids drift to the mean of their members, and the readout panel tracks accuracy, inertia and drift each pass.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install