You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/05 18:59:23 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

dongjoon-hyun commented on a change in pull request #31760:
URL: https://github.com/apache/spark/pull/31760#discussion_r588589297



##########
File path: python/pyspark/ml/regression.py
##########
@@ -180,10 +180,7 @@ class LinearRegression(_JavaRegressor, _LinearRegressionParams, JavaMLWritable,
     >>> test1 = spark.createDataFrame([(Vectors.sparse(1, [0], [1.0]),)], ["features"])
     >>> abs(model.transform(test1).head().newPrediction - 1.0) < 0.001
     True
-    >>> lr.setParams("vector")
-    Traceback (most recent call last):
-        ...
-    TypeError: Method setParams forces keyword arguments.
+    >>> lr.setParams(featuresCol="vector")

Review comment:
       Hi, @srowen . +1 for removing this ancient `TypeError` example (added 5 year ago). In this case, we can do partial check like the following.
   ```python
   >>> lr.setParams(featuresCol="vector")
   LinearRegression...
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org