Details
Description
If LogisticRegression.getThreshold is called with model having multiple thresholds we suppose to raise an exception,
ValueError: Logistic Regression getThreshold only applies to binary classification ...
However, thresholds (List[float]) are incorrectly passed to str.join, resulting in unintended TypeError
>>> 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