[no subject]

2015-02-18 Thread Luca Puggini



Re: generate a random matrix with uniform distribution

2015-02-09 Thread Luca Puggini
Thanks a lot!
Can I ask why this code generates a uniform distribution?

If dist is N(0,1) data should be  N(-1, 2).

Let me know.
Thanks,
Luca

2015-02-07 3:00 GMT+00:00 Burak Yavuz brk...@gmail.com:

 Hi,

 You can do the following:
 ```
 import org.apache.spark.mllib.linalg.distributed.RowMatrix
 import org.apache.spark.mllib.random._

 // sc is the spark context, numPartitions is the number of partitions you
 want the RDD to be in
 val dist: RDD[Vector] = RandomRDDs.normalVectorRDD(sc, n, k,
 numPartitions, seed)
 // make the distribution uniform between (-1, 1)
 val data = dist.map(_ * 2  - 1)
 val matrix = new RowMatrix(data, n, k)
 On Feb 6, 2015 11:18 AM, Donbeo lucapug...@gmail.com wrote:

 Hi
 I would like to know how can I generate a random matrix where each element
 come from a uniform distribution in -1, 1 .

 In particular I would like the matrix be a distributed row matrix with
 dimension n x p

 Is this possible with mllib? Should I use another library?



 --
 View this message in context:
 http://apache-spark-user-list.1001560.n3.nabble.com/generate-a-random-matrix-with-uniform-distribution-tp21538.html
 Sent from the Apache Spark User List mailing list archive at Nabble.com.

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




matrix of random variables with spark.

2015-02-06 Thread Luca Puggini
Hi all,
this is my first email with this mailing list and I hope that I am not
doing anything wrong.

I am currently trying to define a distributed matrix with n rows and k
columns where each element is randomly sampled by a uniform distribution.
How can I do that?

It would be also nice if you can suggest me any good guide that I can use
to start working with Spark. (The quick start tutorial is not enough for me
)

Thanks a lot !