KMeans machine learning algorithm in Scala, performed on optical digit recognition