ML on Apple ][+

https://news.ycombinator.com/rss Hits: 13
Summary

Wait. Does k-means count as machine learning? Yes. Yes, it does. CS229 is the graduate-level machine learning course I took at Stanford as part of the Graduate Certificate in AI which I received back in 2021. While k-means is my choice as the easiest to understand algorithm in machine learning, it was taught as the introductory clustering algorithm for unsupervised learning. As a TA for XCS229, which I have been doing since 2022 and most recently did this Spring, I know that it is still being taught as part of this seminal course in AI. We have liftoff! Unlike previously where I saved the result for the end, let’s start by taking a look at the algorithm in action! Here is a screenshot of the final decision boundary after convergence. The final accuracy is 90% because 1 of the 10 observations is on the incorrect side of the decision boundary. For debugging purposes, to speed up execution, I reduced the number of samples in each class to 5. (You might note that, on the graph, there are only 4 points in class 1, which are the □s. That’s because one of the points is at (291, 90), which is off the edge of the screen. Gaussian distributions can generate extreme outliers, so I decided to preserve those points rather than clip them to the edge of the screen.) That’s obviously pretty small but you can see the algorithm iterating. At the end of each loop I draw a line between the latest estimates of cluster centroids. The perpendicular bisector of these segments are the decision boundaries between the classes, so I draw them, too. Some of the code was written to handle more than two classes but here there are only two which makes this relatively easy. K-means explained K-means clustering is a recursive algorithm that aims to partition \(n\) observations into \(k\) clusters in which each observation belongs to the cluster with the nearest mean, called the cluster centroid. Step Description Initialize Produce and initial set of k cluster centroids. This can be done by randomly ...

First seen: 2025-09-29 18:34

Last seen: 2025-09-30 06:36