I hereby claim:
- I am cmcbride on github.
- I am cmcbride (https://keybase.io/cmcbride) on keybase.
- I have a public key ASA9sGOXeTsPKKs8InpZXzPbfGr3v0ehS9zIdPDK6pK1Rwo
To claim this, I am signing this object:
import org.apache.spark.mllib.linalg.{Vector, Vectors, Matrices} | |
import org.apache.spark.mllib.linalg.distributed.{IndexedRow, IndexedRowMatrix} | |
// Ensure a properly ordered local vector from a distributed RDD | |
// (Int,Double) corresponds to (index, value) where index is the proper order | |
def array_from_rdd( rdd: RDD[(Int,Double)] ) : Array[Double] = | |
rdd.sortBy(_._1).map(_._2).toArray | |
def vec_from_rdd( rdd: RDD[(Int,Double)] ) = | |
Vectors.dense( array_from_rdd( rdd ) ) |
I hereby claim:
To claim this, I am signing this object: