Using K-means on images
Playing around with K-means clustering and images¶
I wanted to see what kind of machine learning tools can be used on maps (I like maps). My first thought was "I can't go about labeling each pixel on a map or satellite image, that would take forever". My next though was "I should use an unsupervised algorithm". Of course, this a vast field of study (duh!) and there are tons of applications of unsupervised algorithms to imaging. I'm going to try to see if K-means clustering can distinguish features in images. This should be fun, because unlike many other applications of clustering, the results here will be totally visual.
Benchmarking the LOOCV
Benchmarking fastloocv¶
In this post I will benchmark the fastloocv code I presented in my previous post.
LOO cross-validation with python
There is a type of cross-validation procedure called leave one out cross-validation (LOOCV). It is very similar to the more commonly used $k-fold$ cross-validation. In fact, LOOCV can be seen as a special case of $k-fold$ CV with $k=n$, where n is the number of data points. In other words, LOOCV trains the statistical model on every possible set containing $n-1$ data points and then tests it on the $n^{th}$ point.