[
https://issues.apache.org/jira/browse/SPARK-19400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joseph K. Bradley resolved SPARK-19400.
---------------------------------------
Resolution: Fixed
Fix Version/s: 2.2.0
Issue resolved by pull request 16740
[https://github.com/apache/spark/pull/16740]
> GLM fails for intercept only model
> ----------------------------------
>
> Key: SPARK-19400
> URL: https://issues.apache.org/jira/browse/SPARK-19400
> Project: Spark
> Issue Type: Bug
> Components: ML
> Reporter: Wayne Zhang
> Assignee: Wayne Zhang
> Fix For: 2.2.0
>
>
> Intercept-only GLM fails for non-Gaussian family because of reducing an empty
> array in IWLS.
> {code}
> val dataset = Seq(
> (1.0, 1.0, 2.0, 0.0, 5.0),
> (0.5, 2.0, 1.0, 1.0, 2.0),
> (1.0, 3.0, 0.5, 2.0, 1.0),
> (2.0, 4.0, 1.5, 3.0, 3.0)
> ).toDF("y", "w", "off", "x1", "x2")
> val formula = new RFormula().setFormula("y ~ 1")
> val output = formula.fit(dataset).transform(dataset)
> val glr = new GeneralizedLinearRegression().setFamily("poisson")
> val model = glr.fit(output)
> java.lang.UnsupportedOperationException: empty.reduceLeft
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]