[
https://issues.apache.org/jira/browse/SPARK-15096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15274953#comment-15274953
]
Apache Spark commented on SPARK-15096:
--------------------------------------
User 'wangmiao1981' has created a pull request for this issue:
https://github.com/apache/spark/pull/12969
> LogisticRegression MultiClassSummarizer numClasses can fail if no valid
> labels are found
> ----------------------------------------------------------------------------------------
>
> Key: SPARK-15096
> URL: https://issues.apache.org/jira/browse/SPARK-15096
> Project: Spark
> Issue Type: Bug
> Components: ML
> Affects Versions: 2.0.0
> Reporter: Joseph K. Bradley
> Priority: Minor
>
> LogisticRegression.train calls labelSummarizer.histogram before it calls
> labelSummarizer.countInvalid:
> [https://github.com/apache/spark/blob/f5623b460224ce363316c63f5d28947215078fc5/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L292]
> But if there are no valid labels, it is possible to get an Exception from
> empty.max when numClasses is called here:
> [https://github.com/apache/spark/blob/f5623b460224ce363316c63f5d28947215078fc5/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L751]
> Proposed fix: We should fix numClasses to throw a better exception:
> [https://github.com/apache/spark/blob/f5623b460224ce363316c63f5d28947215078fc5/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L747]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]