Please following the code examples from the user guide:
http://spark.apache.org/docs/latest/programming-guide.html#passing-functions-to-spark.
-Xiangrui

On Tue, May 26, 2015 at 12:34 AM, Yasemin Kaya <godo...@gmail.com> wrote:
> Hi,
>
> In CF
>
> String path = "data/mllib/als/test.data";
> JavaRDD<String> data = sc.textFile(path);
> JavaRDD<Rating> ratings = data.map(new Function<String, Rating>() {
> public Rating call(String s) {
> String[] sarray = s.split(",");
> return new Rating(Integer.parseInt(sarray[0]), Integer
> .parseInt(sarray[1]), Double.parseDouble(sarray[2]));
> }
> });
>
> implemented like that.
>
> I want to use CF for my data set, but it is JavaPairRDD<String,
> List<Integer>> . How can I convert my dataset to JavaRDD<Rating>. Thank
> you..
>
> Best,
> yasemin
>
>
> --
> hiç ender hiç

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to