class Spark::Command::Sample
Public Instance Methods
_sampler()
click to toggle source
# File lib/spark/command/statistic.rb, line 23 def _sampler if @with_replacement sampler = Spark::Sampler::Poisson else sampler = Spark::Sampler::Uniform end sampler = sampler.new(@fraction, @seed) end
lazy_run(iterator, _)
click to toggle source
# File lib/spark/command/statistic.rb, line 15 def lazy_run(iterator, _) sampler.lazy_sample(iterator) end
run(iterator, _)
click to toggle source
# File lib/spark/command/statistic.rb, line 11 def run(iterator, _) sampler.sample(iterator) end
sampler()
click to toggle source
# File lib/spark/command/statistic.rb, line 19 def sampler @sampler ||= _sampler end