spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph K. Bradley (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-15096) LogisticRegression MultiClassSummarizer numClasses can fail if no valid labels are found
Date Tue, 03 May 2016 19:49:13 GMT
Joseph K. Bradley created SPARK-15096:
-----------------------------------------

             Summary: 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message