Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19122#discussion_r136915493
  
    --- 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 --
    
    We will do multi-model training when fitting on the estimator. So I think 
it's still beneficial to cache training dataset?



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to