Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -1044,7 +1044,8 @@ class GeneralizedLinearRegressionSummary private[regression] (
*/
@Since("2.0.0")
lazy val dispersion: Double = if (
model.getFamily == Binomial.name || model.getFamily == Poisson.name) {
model.getFamily.toLowerCase == Binomial.name ||
model.getFamily.toLowerCase == Poisson.name) {
1.0
} else {
val rss = pearsonResiduals.agg(sum(pow(col("pearsonResiduals"), 2.0))).first().getDouble(0)
Expand DownExpand Up@@ -1147,7 +1148,8 @@ class GeneralizedLinearRegressionTrainingSummary private[regression] (
@Since("2.0.0")
lazy val pValues: Array[Double] = {
if (isNormalSolver) {
if (model.getFamily == Binomial.name || model.getFamily == Poisson.name) {
if (model.getFamily.toLowerCase == Binomial.name ||
model.getFamily.toLowerCase == Poisson.name) {
tValues.map { x => 2.0 * (1.0 - dist.Gaussian(0.0, 1.0).cdf(math.abs(x))) }
} else {
tValues.map { x =>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -758,7 +758,7 @@ class GeneralizedLinearRegressionSuite
0.028480 0.069123 0.935495 -0.049613
*/
val trainer = new GeneralizedLinearRegression()
.setFamily("binomial")
.setFamily("Binomial")
.setWeightCol("weight")
.setFitIntercept(false)

Expand DownExpand Up@@ -875,7 +875,7 @@ class GeneralizedLinearRegressionSuite
-0.4378554 0.2189277 0.1459518 -0.1094638
*/
val trainer = new GeneralizedLinearRegression()
.setFamily("poisson")
.setFamily("Poisson")
.setWeightCol("weight")
.setFitIntercept(true)

Expand Down