Skip to content

Commit

Permalink
GLM fix: throw IAE in case there are no predictor columns and no inte…
Browse files Browse the repository at this point in the history
…rcept.
  • Loading branch information
tomasnykodym committed Apr 16, 2015
1 parent 9497e00 commit 82c1f92
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 @@ -462,7 +462,8 @@ private double computeIntercept(DataInfo dinfo, double ymu, Vec offset, Vec resp
//pass
}
toEnum = family == Family.binomial && (!response.isEnum() && (response.min() < 0 || response.max() > 1));

if(source2.numCols() <= 1 && !intercept)
throw new IllegalArgumentException("There are no predictors left after ignoring constant columns in the dataset and no intercept => No parameters to estimate.");
Frame fr = DataInfo.prepareFrame(source2, response, new int[0], toEnum, true, true);
if(offset != null){ // now put the offset just in front of response
int id = source.find(offset);
Expand Down

0 comments on commit 82c1f92

Please sign in to comment.