'pearson'에 해당되는 글 1건

  1. 2015.11.09 spark 피어슨 상관계수 계산

import org.apache.spark.mllib.linalg._

import org.apache.spark.mllib.stat.Statistics


val r1 = util.Random.shuffle(0 to 10000).map(_.toDouble)

val r2 = util.Random.shuffle(0 to 10000).map(_.toDouble)


val r1RDD = sc.parallelize(r1, 5)

val r2RDD = sc.parallelize(r2, 5)


val corr = Statistics.corr(r1RDD, r2RDD, "pearson")

Posted by FeliZ_하늘..

댓글을 달아 주세요