Skip to content

Commit

Permalink
fixed test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
wendycwong committed Oct 25, 2024
1 parent f1a2948 commit 7756e2a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions h2o-algos/src/test/java/hex/hglm/HGLMBasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ public void testRandomInterceptOnly() {
}

@Test
public void testPredictionMetricsSumaryScoringHistoryWRIntercept() {
public void testPredictionMetricsSummaryScoringHistoryWRIntercept() {
try {
Scope.enter();
double[] initBeta = new double[]{0.57305, 0.95066, 0.4277, 0.2814, 0.3727};
Expand Down Expand Up @@ -769,7 +769,7 @@ public void testPredictionMetricsSumaryScoringHistoryWRIntercept() {
}

@Test
public void testPredictionMetricsSumaryScoringHistoryWORIntercept() {
public void testPredictionMetricsSummaryScoringHistoryWORIntercept() {
try {
Scope.enter();
double[] initBeta = new double[]{0.57305, 0.95066, 0.4277, 0.2814, 0.3727};
Expand Down Expand Up @@ -797,12 +797,16 @@ public void testPredictionMetricsSumaryScoringHistoryWORIntercept() {
DKV.put(validFr);
Scope.track(fr);
Scope.track(validFr);
fr.replace(0, fr.vec(0).toCategoricalVec()).remove();
DKV.put(fr);
Scope.track(fr);
SplitFrame sf = new SplitFrame(validFr, new double[]{0.1, 0.9}, new Key[]{Key.make("train.hex"), Key.make("test.hex")});
sf.exec().get();
Key[] ksplits = sf._destination_frames;
Frame tr = DKV.get(ksplits[0]).get();
Scope.track(tr);
Frame te = DKV.get(ksplits[1]).get();
Scope.track(te);
HGLMModel.HGLMParameters parms = new HGLMModel.HGLMParameters();
parms._train = fr._key;
parms._valid = validFr._key;
parms._valid = te._key;
parms._response_column = "y";
parms._ignored_columns = new String[]{"x2", "x4"};
parms._ignore_const_cols = true;
Expand All @@ -814,7 +818,6 @@ public void testPredictionMetricsSumaryScoringHistoryWORIntercept() {
parms._initial_fixed_effects = initBeta;
parms._initial_random_effects = ubetaInitFrame._key;
parms._random_intercept = false;

HGLMModel modelNS = new HGLM(parms).trainModel().get();
Scope.track_generic(modelNS);
Frame predFrameNS = modelNS.score(fr);
Expand Down Expand Up @@ -864,8 +867,9 @@ public void fillDataRows(Frame fr, int rowInd, String[] coefNames, String[] rCoe

int rCoeffLen = rCoeffNames.length;
for (int index=0; index<rCoeffLen; index++)
if (rCoeffNames[index] != "intercept")
if (!"intercept".equals(rCoeffNames[index])) {
zvals[index] = fr.vec(rCoeffNames[index]).at(rowInd);
}
}

@Test
Expand Down

0 comments on commit 7756e2a

Please sign in to comment.