Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/22076#discussion_r209454605
--- Diff: python/pyspark/ml/tests.py ---
@@ -950,6 +950,13 @@ def test_fit_maximize_metric(self):
"Best model should have zero induced error")
self.assertEqual(1.0, bestModelMetric, "Best model has R-squared
of 1")
+ def test_param_grid_type_coercion(self):
+ lr = LogisticRegression(maxIter=10)
+ paramGrid = ParamGridBuilder().addGrid(lr.regParam, [0.5,
1]).build()
+ for param in paramGrid:
+ for v in param.values():
+ assert(type(v) is float)
--- End diff --
nit: `type(v) == float `
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]