Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/12020#discussion_r58596611
--- Diff: python/pyspark/ml/tuning.py ---
@@ -91,7 +94,90 @@ def build(self):
return [dict(zip(keys, prod)) for prod in
itertools.product(*grid_values)]
-class CrossValidator(Estimator, HasSeed):
+class ValidatorParams(Params):
+ """
+ Common params for TrainValidationSplit and CrossValidator.
+ """
+
+ estimator = Param(Params._dummy(), "estimator", "estimator to be
cross-validated")
+ estimatorParamMaps = Param(Params._dummy(), "estimatorParamMaps",
"estimator param maps")
+ evaluator = Param(
+ Params._dummy(), "evaluator",
+ "evaluator used to select hyper-parameters that maximize the
validator metric")
+
+ def __init__(self):
+ super(ValidatorParams, self).__init__()
+
+ def setEstimator(self, value):
+ """
+ Sets the value of :py:attr:`estimator`.
+ """
+ self._paramMap[self.estimator] = value
--- End diff --
As long as this is being modified, each of these should call ```_set```
rather than accessing ```_paramMap``` directly
---
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]