apache/spark — pull request #3609 by emtl97 (2014-12-04 21:12:06+00:00)
Title: Update DecisionTree.scala

Hello,

Hope you are well. We've been using DecisionTree at Samsung and hope to help in some small way. I was interested in setting the seed for the sampling i.e. in line 988. We're in the process of creating tests for our code being able to set the seed is helpful.

To that end, I think also the sample method here depends on a PartitionwiseSampledRDD. In there the 'compute' method think uses a different seed from the one that can be passed to the constructor of PartitionSampledRDD, it uses split.seed (below). Well hope we can discuss more! Thank you.. Best Wishes -Ed

override def compute(splitIn: Partition, context: TaskContext): Iterator[U] = {
val split = splitIn.asInstanceOf[PartitionwiseSampledRDDPartition]
val thisSampler = sampler.clone
thisSampler.setSeed(split.seed)
thisSampler.sample(firstParent[T].iterator(split.prev, context))
}