copying some GLM tests, just using KMeans instead