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 17:27:32 UTC

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

srowen commented on a change in pull request #31760:
URL: https://github.com/apache/spark/pull/31760#discussion_r588499834



##########
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:
       @HyukjinKwon is it correct here just to specify no output from this command? I don't think we care about testing any output of this. I don't know how python docs work though :)




----------------------------------------------------------------
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