The train method is on the Companion Object
https://spark.apache.org/docs/2.1.0/api/scala/index.html#org.apache.spark.mllib.clustering.KMeans$
here is a decent resource on Companion Object usage:
https://docs.scala-lang.org/tour/singleton-objects.html
On Wed, Dec 13, 2017 at 9:16 AM Michael Segel
Hi,
Just came across this while looking at the docs on how to use Spark’s Kmeans
clustering.
Note: This appears to be true in both 2.1 and 2.2 documentation.
The overview page:
https://spark.apache.org/docs/2.1.0/mllib-clustering.html#k-means
Here’ the example contains the following line:
val