From 7756e2a7adaf431129b9fbb40f213594631b56b8 Mon Sep 17 00:00:00 2001 From: wendycwong Date: Fri, 25 Oct 2024 10:23:41 -0700 Subject: [PATCH] fixed test failure --- .../src/test/java/hex/hglm/HGLMBasicTest.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/h2o-algos/src/test/java/hex/hglm/HGLMBasicTest.java b/h2o-algos/src/test/java/hex/hglm/HGLMBasicTest.java index 9d1e191cc5ce..cd679024b89d 100644 --- a/h2o-algos/src/test/java/hex/hglm/HGLMBasicTest.java +++ b/h2o-algos/src/test/java/hex/hglm/HGLMBasicTest.java @@ -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}; @@ -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}; @@ -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; @@ -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); @@ -864,8 +867,9 @@ public void fillDataRows(Frame fr, int rowInd, String[] coefNames, String[] rCoe int rCoeffLen = rCoeffNames.length; for (int index=0; index