はじめに 先日の Mahout Project からのアナウンス “Goodbye MapReduce” にもあるとおり、今後の大規模データ処理の基盤として Apache Spark がここ最近注目されています。 そんな今熱いプロダクトである Spark に関して、その上で動く機械学習ライブラリ MLlib の K-means 実装を わけあって Java から利用してみる機会があったので、その使い方や特性を簡単にまとめてみました。 MLlib の K-means 実装について 現時点 (バージョン 0.9.1) での K-means 実装について、簡単に説明します。 距離計算は「ユークリッド距離」しか提供されていません。 KMeans#findClosest() → MLUtils.fsuaredDistance() のあたりを読むと分かるかと思います。 Spark の JIRA を見て