* Change Booster dump from XGBoosterDumpModel to XGBoosterDumpModelEx Allows exposing multiple formatting options of model dumping.
This commit is contained in:
@@ -231,6 +231,16 @@ public class BoosterImplTest {
|
||||
testWithFastHisto(trainMat, watches, 10, paramMap, 0.0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDumpModelJson() throws XGBoostError {
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
Booster booster = trainBooster(trainMat, testMat);
|
||||
String[] dump = booster.getModelDump("", false, "json");
|
||||
TestCase.assertEquals(" { \"nodeid\":", dump[0].substring(0, 13));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFastHistoDepthwiseMaxDepth() throws XGBoostError {
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
|
||||
Reference in New Issue
Block a user