-
- Downloads
[SPARK-19400][ML] Allow GLM to handle intercept only model
## What changes were proposed in this pull request? Intercept-only GLM is failing for non-Gaussian family because of reducing an empty array in IWLS. The following code `val maxTolOfCoefficients = oldCoefficients.toArray.reduce { (x, y) => math.max(math.abs(x), math.abs(y))` fails in the intercept-only model because `oldCoefficients` is empty. This PR fixes this issue. yanboliang srowen imatiach-msft zhengruifeng ## How was this patch tested? New test for intercept only model. Author: actuaryzhang <actuaryzhang10@gmail.com> Closes #16740 from actuaryzhang/interceptOnly.
Showing
- mllib/src/main/scala/org/apache/spark/ml/optim/IterativelyReweightedLeastSquares.scala 1 addition, 1 deletion...he/spark/ml/optim/IterativelyReweightedLeastSquares.scala
- mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala 4 additions, 0 deletions...che/spark/ml/regression/GeneralizedLinearRegression.scala
- mllib/src/test/scala/org/apache/spark/ml/regression/GeneralizedLinearRegressionSuite.scala 55 additions, 0 deletions...park/ml/regression/GeneralizedLinearRegressionSuite.scala
Loading
Please register or sign in to comment