Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1311#discussion_r14696246
  
    --- Diff: docs/mllib-clustering.md ---
    @@ -69,7 +69,55 @@ println("Within Set Sum of Squared Errors = " + WSSSE)
     All of MLlib's methods use Java-friendly types, so you can import and call 
them there the same
     way you do in Scala. The only caveat is that the methods take Scala RDD 
objects, while the
     Spark Java API uses a separate `JavaRDD` class. You can convert a Java RDD 
to a Scala one by
    -calling `.rdd()` on your `JavaRDD` object.
    +calling `.rdd()` on your `JavaRDD` object. A standalone application example
    +that is equivalent to the provided example in Scala is given bellow:
    +
    +{% highlight java %}
    +import org.apache.spark.api.java.*;
    +import org.apache.spark.SparkConf;
    +import org.apache.spark.api.java.function.Function;
    +import org.apache.spark.mllib.clustering.KMeans;
    +import org.apache.spark.mllib.clustering.KMeansModel;
    +import org.apache.spark.mllib.linalg.Vectors;
    +import org.apache.spark.mllib.linalg.Vector;
    +
    +public class Classifier {
    +    public static void main( String[] args ) {
    --- End diff --
    
    use two spaces for indentation and remove extra spaces inside `main(...)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to