Every listing in an online-course marketplace can be described by a handful of numbers: its price, its duration, its average rating, and its popularity (enrollments). Plotted together, courses that look nothing alike on the surface — a $9 two-hour crash course and a $299 sixty-hour certification — turn out to cluster into a small number of natural buyer niches once you look at their numbers side by side.
This simulation generates a synthetic marketplace of course listings drawn from a handful of hidden buyer archetypes (budget crash-courses, premium certifications, hobbyist enrichment courses, and free intro tasters), then runs the k-means clustering algorithm on the normalised data to see how well an unsupervised algorithm rediscovers those groups from the numbers alone.
k random centroids, assigns every point to its nearest centroid, moves each centroid to the mean of its points, and repeats until the assignments stop changing.Real education marketplaces use exactly this kind of clustering to decide how to price, bundle, and market courses — sellers targeting the "premium certification" segment use very different messaging than sellers chasing high-volume, low-price "crash course" buyers, even though both can be profitable niches.
A synthetic marketplace of online-course listings is plotted in 3D by price, duration/popularity and rating, then split into buyer segments live with the k-means clustering algorithm.
K-means repeatedly assigns each course to its nearest cluster centre and recomputes the centre as the mean of its members, gradually converging on natural buyer niches such as budget crash-courses, premium certifications, and free intro tasters.
Choose how many clusters (k) to search for and how many listings to sample, switch the vertical axis between duration and popularity, and watch inertia drop as the algorithm converges. Resample for a fresh marketplace.
The same clustering approach that groups course listings here is used by real education marketplaces to decide pricing tiers, bundle offers, and ad targeting for each buyer segment.