[
https://issues.apache.org/jira/browse/SPARK-38243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sean R. Owen resolved SPARK-38243.
----------------------------------
Fix Version/s: 3.3.0
Resolution: Fixed
Issue resolved by pull request 35558
[https://github.com/apache/spark/pull/35558]
> Unintended exception thrown in pyspark.ml.LogisticRegression.getThreshold
> -------------------------------------------------------------------------
>
> Key: SPARK-38243
> URL: https://issues.apache.org/jira/browse/SPARK-38243
> Project: Spark
> Issue Type: Bug
> Components: ML, PySpark
> Affects Versions: 2.4.0, 3.1.0, 3.2.0, 3.3.0
> Reporter: Maciej Szymkiewicz
> Assignee: Maciej Szymkiewicz
> Priority: Minor
> Fix For: 3.3.0
>
>
> If {{LogisticRegression.getThreshold}} is called with model having multiple
> thresholds we suppose to raise an exception,
> {code:python}
> ValueError: Logistic Regression getThreshold only applies to binary
> classification ...
> {code}
> However, {{thresholds}} ({{{}List[float]{}}}) are incorrectly passed to
> {{{}str.join{}}}, resulting in unintended {{TypeError}}
> {code:python}
> >>> from pyspark.ml.classification import LogisticRegression
> ...
> ... model = LogisticRegression(thresholds=[1.0, 2.0, 3.0])
> >>> model.getThreshold()
> Traceback (most recent call last):
> Input In [7] in <module>
> model.getThreshold()
> File /path/to/spark/python/pyspark/ml/classification.py:1003 in getThreshold
> + ",".join(ts)
> Type Error: sequence item 0: expected str instance, float found
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]