use of hex.drf.DRF in project h2o-2 by h2oai.
the class DHistTest method testDBinom.
@Test
public void testDBinom() {
DRF drf = new DRF();
Key destTrain = Key.make("data.hex");
DRFModel model = null;
try {
// Configure DRF
drf.source = parseFrame(destTrain, "../smalldata/histogram_test/alphabet_cattest.csv");
drf.response = drf.source.vecs()[1];
drf.classification = true;
drf.ntrees = 100;
// = interaction.depth
drf.max_depth = 5;
// = nodesize
drf.min_rows = 10;
drf.nbins = 100;
drf.destination_key = Key.make("DRF_model_dhist.hex");
// Invoke DRF and block till the end
drf.invoke();
// Get the model
model = UKV.get(drf.dest());
} finally {
drf.source.delete();
drf.remove();
// Remove the model
if (model != null)
model.delete();
}
}
use of hex.drf.DRF in project h2o-2 by h2oai.
the class ModelSerializationTest method prepareDRFModel.
private DRFModel prepareDRFModel(String dataset, int[] ignores, int response, boolean classification, int ntrees) {
Frame f = parseFrame(dataset);
try {
DRF drf = new DRF();
Vec respVec = f.vec(response);
drf.source = f;
drf.response = respVec;
drf.classification = classification;
drf.ntrees = ntrees;
drf.score_each_iteration = true;
drf.invoke();
return UKV.get(drf.dest());
} finally {
if (f != null)
f.delete();
}
}