Skip to content

Commit

Permalink
GLM front-end fix: fix the AIOOB occurring when there was an offset c…
Browse files Browse the repository at this point in the history
…olumn with ignored columns occurring after (higher ids) cause removing the offset changed ids by -1.

Fixed by removing the ignored cols prior to removing the offset column.
  • Loading branch information
tomasnykodym committed Apr 8, 2015
1 parent bd70457 commit 8a615a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/hex/glm/GLM2.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ private double computeIntercept(DataInfo dinfo, double ymu, Vec offset, Vec resp
int id = source.find(offset);
int idx = Arrays.binarySearch(ignored_cols, id);
if (idx >= 0) Utils.remove(ignored_cols, idx);
source2.remove(ignored_cols);
String name = source2.names()[id];
// source2.add(name, source2.remove(id));
_noffsets = 1;
Expand Down Expand Up @@ -477,7 +478,7 @@ private double computeIntercept(DataInfo dinfo, double ymu, Vec offset, Vec resp
source2.remove(offsetId);
}

Frame fr = DataInfo.prepareFrame(source2, response, ignored_cols, toEnum, true, true);
Frame fr = DataInfo.prepareFrame(source2, response, new int[0], toEnum, true, true);
if(offset != null){ // now put the offset just before response
String responseName = fr.names()[fr.numCols()-1];
Vec responseVec = fr.remove(fr.numCols()-1);
Expand Down

0 comments on commit 8a615a2

Please sign in to comment.