Skip to content

Commit

Permalink
Merge pull request #523 from mpjlu/fixALSRandom
Browse files Browse the repository at this point in the history
ALS prepare data to support scala 2.10
  • Loading branch information
Meng, Peng authored Nov 6, 2017
2 parents dc77558 + 2bfa491 commit 133dc48
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import org.apache.spark.mllib.random._
import org.apache.spark.rdd.{PairRDDFunctions, RDD}
import org.apache.spark.mllib.linalg.{Vectors, Vector}

import scala.util.Random

object RatingDataGenerator {

def main(args: Array[String]): Unit = {
Expand Down Expand Up @@ -64,7 +62,7 @@ object RatingDataGenerator {
}

val rawData: RDD[Vector] = RandomRDDs.normalVectorRDD(sc, numUsers, numProducts, numPartitions)
val rng = new Random()
val rng = new java.util.Random()
val data = rawData.map{v =>
val a = Array.fill[Double](v.size)(0.0)
v.foreachActive{(i,vi) =>
Expand Down

0 comments on commit 133dc48

Please sign in to comment.