Agree, it's correct in the linear methods doc page too. You can open a
PR for this simple 'typo' fix; I imagine it just wasn't updated or
fixed with the others.

On Fri, Feb 13, 2015 at 4:26 PM, Emre Sevinc <[email protected]> wrote:
> Hello,
>
> I was trying the streaming kmeans clustering example in the official
> documentation at:
>
>    http://spark.apache.org/docs/1.2.0/mllib-clustering.html
>
> But I've got a type error when I tried to compile the code:
>
> [error]  found   :
> org.apache.spark.streaming.dstream.DStream[org.apache.spark.mllib.regression.LabeledPoint]
> [error]  required: org.apache.spark.streaming.dstream.DStream[(?,
> org.apache.spark.mllib.linalg.Vector)]
> [error]     model.predictOnValues(testData).print()
> [error]                           ^
> [error] one error found
> [error] (compile:compile) Compilation failed
>
>
> And it seems like the solution is to use
>
>    model.predictOnValues(testData.map(lp => (lp.label,
> lp.features))).print()
>
> as shown in
> https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/mllib/StreamingKMeansExample.scala
>
> instead of
>
>    model.predictOnValues(testData).print()
>
> as written in the documentation.
>
> I just wanted to draw the attention to this, so that one of the maintainers
> can fix the documentation.
>
> --
> Emre Sevinç

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

Reply via email to