Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/12767#discussion_r62414567
--- Diff: python/pyspark/ml/tests.py ---
@@ -586,10 +589,13 @@ def test_fit_maximize_metric(self):
tvsModel = tvs.fit(dataset)
bestModel = tvsModel.bestModel
bestModelMetric = evaluator.evaluate(bestModel.transform(dataset))
+ validationMetrics = tvsModel.validationMetrics
self.assertEqual(0.0, bestModel.getOrDefault('inducedError'),
"Best model should have zero induced error")
self.assertEqual(1.0, bestModelMetric, "Best model has R-squared
of 1")
+ self.assertEqual(len(grid), len(validationMetrics),
--- End diff --
It may be overkill but it should be easy to also test that the best value
in `validationMetrics` equals `bestModelMetric`
---
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]