Write-up for k-means and k-nearest neighbors