mixle.data.sources.spark_source moduleΒΆ
Spark-backed sampling helpers for sequence-encodable Mixle distributions.
The functions in this module broadcast distribution objects to Spark workers, draw reproducible partition-level samples, and return RDDs that can feed larger distributed estimation workflows.
- take_sample(rdd, with_replacement, n, seed=None)[source]
Take a deterministic-order random sample from a Spark RDD.
- sample_seq_as_rdd(sc, dist, seq_len, count_per_split, num_splits, seed=None)[source]
Sample fixed-length sequences from a distribution into a Spark RDD.
- sample_rdd(sc, dist, count_per_split, num_splits, seed=None)[source]
Sample independent draws from a distribution into a Spark RDD.