Github user imatiach-msft commented on a diff in the pull request:
https://github.com/apache/spark/pull/16699#discussion_r97872960
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
---
@@ -358,13 +384,13 @@ object GeneralizedLinearRegression extends
DefaultParamsReadable[GeneralizedLine
* The reweight function used to update offsets and weights
* at each iteration of [[IterativelyReweightedLeastSquares]].
*/
- val reweightFunc: (Instance, WeightedLeastSquaresModel) => (Double,
Double) = {
- (instance: Instance, model: WeightedLeastSquaresModel) => {
- val eta = model.predict(instance.features)
+ val reweightFunc: (GLRInstance, WeightedLeastSquaresModel) => (Double,
Double) = {
+ (instance: GLRInstance, model: WeightedLeastSquaresModel) => {
+ val eta = model.predict(instance.features) + instance.offset
--- End diff --
minor suggestion - instead of doing:
eta = prediction + offset
mu = fitted(eta)
newLabel = eta - offset + stuff
maybe do:
eta = prediction
mu = fitted(eta + offset)
newLabel = eta + stuff
---
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]