You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Joseph K. Bradley (JIRA)" <ji...@apache.org> on 2016/05/03 21:49:13 UTC
[jira] [Created] (SPARK-15096) LogisticRegression
MultiClassSummarizer numClasses can fail if no valid labels are found
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