```scala
(1 to numFolds).map { fold =>
  val sampler = new BernoulliSampler[T]((fold-1)/foldsF,fold/foldsF, complement = false)
  val train = new PartitionwiseSampledRDD(rdd, sampler , seed)
  val test = new PartitionwiseSampledRDD(rdd, sampler , seed.complement)  // might need to create this
  (train, test)
}
```

Make sure you rename folds to numFolds.