new RandomRDDs()
- Source:
Methods
(static) normalRDD(sc, size, numPartitionsopt, seedopt) → {module:eclairjs/rdd.RDD}
Generates an RDD comprised of `i.i.d.` samples from the standard normal distribution.
To transform the distribution in the generated RDD from standard normal to some other normal
`N(mean, sigma^2^)`, use `RandomRDDs.normalRDD(sc, n, p, seed).map(v => mean + sigma * v)`.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sc |
module:eclairjs.SparkContext | SparkContext used to create the RDD. | |
size |
number | Size of the RDD. | |
numPartitions |
number |
<optional> |
Number of partitions in the RDD (default: `sc.defaultParallelism`). |
seed |
number |
<optional> |
Random seed (default: a random long integer). |
- Source:
Returns:
RDD[Double] Optional comprised of `i.i.d.` samples ~ N(0.0, 1.0).
(static) normalVectorRDD(sc, numRows, numCols, numPartitionsopt, seedopt) → {module:eclairjs/rdd.RDD}
Generates an RDD[Vector] with vectors containing `i.i.d.` samples drawn from the
standard normal distribution.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sc |
module:eclairjs.SparkContext | SparkContext used to create the RDD. | |
numRows |
number | Number of Vectors in the RDD. | |
numCols |
number | Number of elements in each Vector. | |
numPartitions |
number |
<optional> |
Number of partitions in the RDD (default: `sc.defaultParallelism`). |
seed |
number |
<optional> |
Random seed (default: a random long integer). |
- Source:
Returns:
RDD[Vector] with vectors containing `i.i.d.` samples ~ `N(0.0, 1.0)`.