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

    https://github.com/apache/spark/pull/10244#discussion_r47393774
  
    --- Diff: 
examples/src/main/scala/org/apache/spark/examples/ml/KMeansExample.scala ---
    @@ -50,6 +51,7 @@ object KMeansExample {
         val sc = new SparkContext(conf)
         val sqlContext = new SQLContext(sc)
     
    +    // $example on$
         // Loads data
         val rowRDD = sc.textFile(input).filter(_.nonEmpty)
           .map(_.split(" ").map(_.toDouble)).map(Vectors.dense).map(Row(_))
    --- End diff --
    
    As long as this file is being changed, let's simplify the example a little:
    Rather than mapping to Row and creating a schema explicitly, how about 
following what is done here: 
[https://github.com/apache/spark/blob/c119a34d1e9e599e302acfda92e5de681086a19f/examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala].
  The "label" could be replaced by an "id"


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to