Skip to content

Commit

Permalink
Fixed proximal interface in glm.
Browse files Browse the repository at this point in the history
There was a bug in intercept adjustment for data normalization of the w-given (prior coefficients), was multiplying by normMul (1/sd(x)) instead of normSub (mean(x)) and was adding instead of subtracting to the intercept.
  • Loading branch information
tomasnykodym committed Feb 19, 2015
1 parent e287e30 commit 3562bd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/hex/glm/GLM2.java
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,12 @@ private double computeIntercept(DataInfo dinfo, double ymu, Vec offset, Vec resp
if(_srcDinfo._normMul != null) {
double norm = 0;
for (int i = numoff; i < _srcDinfo.fullN(); ++i) {
norm += _bgs[i] * _srcDinfo._normMul[i-numoff];
norm += _bgs[i] * _srcDinfo._normSub[i-numoff];
_bgs[i] /= _srcDinfo._normMul[i-numoff];

}
if(_intercept == 1)
_bgs[_bgs.length-1] += norm;
_bgs[_bgs.length-1] -= norm;
}
}
if((v = beta_constraints.vec("rho")) != null)
Expand Down

0 comments on commit 3562bd7

Please sign in to comment.