Github user holdenk commented on a diff in the pull request:
https://github.com/apache/spark/pull/18281#discussion_r128629749
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala ---
@@ -337,8 +353,13 @@ final class OneVsRest @Since("1.4.0") (
paramMap.put(classifier.labelCol -> labelColName)
paramMap.put(classifier.featuresCol -> getFeaturesCol)
paramMap.put(classifier.predictionCol -> getPredictionCol)
- classifier.fit(trainingDataset, paramMap)
- }.toArray[ClassificationModel[_, _]]
+ Future {
+ classifier.fit(trainingDataset, paramMap)
+ }(executionContext)
+ }
+ val models = modelFutures
+ .map(ThreadUtils.awaitResult(_,
Duration.Inf)).toArray[ClassificationModel[_, _]]
--- End diff --
Would it be more idomatic to use `Future.sequence(` here and just wait on
the Future[List] ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]