Github user dbtsai commented on a diff in the pull request:
https://github.com/apache/spark/pull/6927#discussion_r32902955
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
@@ -121,8 +131,9 @@ class LinearRegression(override val uid: String)
})
val numFeatures = summarizer.mean.size
- val yMean = statCounter.mean
+ val yMean = if ($(fitIntercept)) statCounter.mean else 0.0
--- End diff --
I think passing $(fitIntercept) into `LeastSquaresAggregator` to set
`offset` as zero will be cleaner. I will send out another PR proving that
`offset` zero is the same optimizing without intercept.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]