Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/19122#discussion_r137162089
--- Diff: python/pyspark/ml/tuning.py ---
@@ -255,18 +257,23 @@ def _fit(self, dataset):
randCol = self.uid + "_rand"
df = dataset.select("*", rand(seed).alias(randCol))
metrics = [0.0] * numModels
+
+ pool = ThreadPool(processes=min(self.getParallelism(), numModels))
+
for i in range(nFolds):
validateLB = i * h
validateUB = (i + 1) * h
condition = (df[randCol] >= validateLB) & (df[randCol] <
validateUB)
- validation = df.filter(condition)
+ validation = df.filter(condition).cache()
--- End diff --
That's right, but seems we don't check if input dataset is cached or not
here? Should we cache it if it is not cached?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]