Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/10469#discussion_r50902970
--- Diff: python/pyspark/ml/regression.py ---
@@ -68,6 +68,30 @@ class LinearRegression(JavaEstimator, HasFeaturesCol,
HasLabelCol, HasPrediction
Traceback (most recent call last):
...
TypeError: Method setParams forces keyword arguments.
+ >>> import os, tempfile
+ >>> path = tempfile.mkdtemp()
+ >>> lr_path = path + "/lr"
+ >>> lr.save(lr_path)
+ >>> lr2 = LinearRegression.load(lr_path)
+ >>> lr2.getOrDefault(lr2.getParam("maxIter"))
+ 5
+ >>> model2 = lr2.fit(df)
--- End diff --
Actually, I don't think you need to fit a second model. If the goal is to
test that all params are the same, that should be done explicitly in a unit
test (but it's OK with me not to).
---
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]