'correlation'에 해당되는 글 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_하늘..
,