Skip to content

Commit

Permalink
Update DRFTest that changed with previous fix HEXDEV-319.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnocandel committed May 19, 2015
1 parent 79a6989 commit 7848dd1
Showing 1 changed file with 47 additions and 3 deletions.
50 changes: 47 additions & 3 deletions src/test/java/hex/drf/DRFTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import static org.junit.Assert.assertEquals;
import water.*;
import water.api.AUC;
import water.api.DRFModelView;
import water.fvec.Frame;
import water.fvec.RebalanceDataSet;
Expand Down Expand Up @@ -100,7 +101,7 @@ abstract static class PrepData { abstract int prep(Frame fr); }
} catch( IllegalArgumentException iae ) { /*pass*/ }
}

@Test public void testBadData() throws Throwable {
@Ignore @Test public void testBadData() throws Throwable {
basicDRFTestOOBE(
"./smalldata/test/drf_infinitys.csv","infinitys.hex",
new PrepData() { @Override int prep(Frame fr) { return fr.find("DateofBirth"); } },
Expand Down Expand Up @@ -161,8 +162,8 @@ public void testCreditProstate1() throws Throwable {
return fr.find("IsDepDelayed"); }
},
50,
a( a(13987, 6900),
a( 6147,16944)),
a( a(13941, 6946),
a( 5885,17206)),
s("NO", "YES"));
}

Expand Down Expand Up @@ -272,4 +273,47 @@ public void basicDRF(String fnametrain, String hexnametrain, String fnametest, S
assertEquals(mses[i], mses[0], 1e-15);
}
}

public static class repro {
@Ignore
@Test public void testAirline() throws InterruptedException {
Frame tfr=null;
Frame test=null;

Scope.enter();
try {
// Load data, hack frames
tfr = parseFrame(Key.make("air.hex"), "/users/arno/sz_bench_data/train-1m.csv");
test = parseFrame(Key.make("airt.hex"), "/users/arno/sz_bench_data/test.csv");

DRF parms = new DRF();
parms.source = tfr;
parms.validation = test;
//parms.ignored_cols_by_name = new int[]{4,5,6};
parms.ignored_cols_by_name = new int[]{1,2,3,4,5,7};
parms.response = tfr.lastVec();
parms.nbins = 20;
parms.ntrees = 1;
parms.max_depth = 5;
parms.mtries = 1;
parms.sample_rate = 1;
parms.min_rows = 1;
parms.classification = true;
parms.seed = 1;

DRFModel drf = parms.fork().get();
Frame pred = drf.score(test);
AUC auc = new AUC();
auc.vactual = test.lastVec();
auc.vpredict = pred.lastVec();
auc.invoke();
Log.info("Test set AUC: " + auc.data().AUC);
drf.delete();
} finally{
if (tfr != null) tfr.delete();
if (test != null) test.delete();
}
Scope.exit();
}
}
}

0 comments on commit 7848dd1

Please sign in to comment.