You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2022/02/13 23:32:00 UTC
[jira] [Resolved] (SPARK-38139) ml.recommendation.ALS doctests failures
[ https://issues.apache.org/jira/browse/SPARK-38139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-38139.
----------------------------------
Fix Version/s: 3.3.0
Resolution: Fixed
Issue resolved by pull request 35503
[https://github.com/apache/spark/pull/35503]
> ml.recommendation.ALS doctests failures
> ---------------------------------------
>
> Key: SPARK-38139
> URL: https://issues.apache.org/jira/browse/SPARK-38139
> Project: Spark
> Issue Type: Bug
> Components: ML, PySpark
> Affects Versions: 3.3.0
> Reporter: Maciej Szymkiewicz
> Assignee: Maciej Szymkiewicz
> Priority: Major
> Fix For: 3.3.0
>
>
> In my dev setups, ml.recommendation:ALS test consistently converges to value lower than expected and fails with:
> {code:python}
> File "/path/to/spark/python/pyspark/ml/recommendation.py", line 322, in __main__.ALS
> Failed example:
> predictions[0]
> Expected:
> Row(user=0, item=2, newPrediction=0.69291...)
> Got:
> Row(user=0, item=2, newPrediction=0.6929099559783936)
> {code}
> In can correct for that, but it creates some noise, so if anyone else experiences this, we could drop a digit from the results
> {code}
> diff --git a/python/pyspark/ml/recommendation.py b/python/pyspark/ml/recommendation.py
> index f0628fb922..b8e2a6097d 100644
> --- a/python/pyspark/ml/recommendation.py
> +++ b/python/pyspark/ml/recommendation.py
> @@ -320,7 +320,7 @@ class ALS(JavaEstimator, _ALSParams, JavaMLWritable, JavaMLReadable):
> >>> test = spark.createDataFrame([(0, 2), (1, 0), (2, 0)], ["user", "item"])
> >>> predictions = sorted(model.transform(test).collect(), key=lambda r: r[0])
> >>> predictions[0]
> - Row(user=0, item=2, newPrediction=0.69291...)
> + Row(user=0, item=2, newPrediction=0.6929...)
> >>> predictions[1]
> Row(user=1, item=0, newPrediction=3.47356...)
> >>> predictions[2]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org