use of water.Job in project h2o-2 by h2oai.
the class DeepLearningProgressPage method toHTML.
@Override
public boolean toHTML(StringBuilder sb) {
Job jjob = Job.findJob(job_key);
if (jjob == null)
return true;
DeepLearningModel m = UKV.get(jjob.dest());
if (m != null)
m.generateHTML("Deep Learning Model", sb);
else
DocGen.HTML.paragraph(sb, "Pending...");
return true;
}
use of water.Job in project h2o-3 by h2oai.
the class QuantileTest method testWeights3.
@Ignore
@Test
public void testWeights3() {
//same behavior as wtd.quantile in R -> results with all weights=1 and all weights=epsilon don't agree (unless normwt=TRUE)
QuantileModel kmm1;
QuantileModel kmm2;
Frame fr1 = null;
Frame fr2 = null;
try {
fr1 = parse_test_file("smalldata/junit/weights_all_tiny.csv");
fr2 = parse_test_file("smalldata/junit/weights_all_ones.csv");
for (QuantileModel.CombineMethod comb : new QuantileModel.CombineMethod[] { QuantileModel.CombineMethod.AVERAGE, QuantileModel.CombineMethod.LOW, QuantileModel.CombineMethod.HIGH, QuantileModel.CombineMethod.INTERPOLATE }) {
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr1._key;
parms._combine_method = comb;
parms._weights_column = "weight";
Job<QuantileModel> job1 = new Quantile(parms).trainModel();
kmm1 = job1.get();
job1.remove();
}
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr2._key;
parms._combine_method = comb;
parms._weights_column = "weight";
Job<QuantileModel> job2 = new Quantile(parms).trainModel();
kmm2 = job2.get();
job2.remove();
}
try {
Assert.assertTrue(Arrays.deepEquals(kmm1._output._quantiles, kmm2._output._quantiles));
} finally {
if (kmm1 != null)
kmm1.delete();
if (kmm2 != null)
kmm2.delete();
}
}
} finally {
if (fr1 != null)
fr1.remove();
if (fr2 != null)
fr2.remove();
}
}
use of water.Job in project h2o-3 by h2oai.
the class QuantileTest method testWeights1.
@Test
public void testWeights1() {
QuantileModel kmm1;
QuantileModel kmm2;
Frame fr1 = null;
Frame fr2 = null;
try {
fr1 = parse_test_file("smalldata/junit/no_weights.csv");
fr2 = parse_test_file("smalldata/junit/weights.csv");
for (QuantileModel.CombineMethod comb : new QuantileModel.CombineMethod[] { QuantileModel.CombineMethod.AVERAGE, QuantileModel.CombineMethod.LOW, QuantileModel.CombineMethod.HIGH, QuantileModel.CombineMethod.INTERPOLATE }) {
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr1._key;
parms._combine_method = comb;
parms._weights_column = null;
Job<QuantileModel> job1 = new Quantile(parms).trainModel();
kmm1 = job1.get();
job1.remove();
}
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr2._key;
parms._combine_method = comb;
parms._weights_column = "weight";
Job<QuantileModel> job2 = new Quantile(parms).trainModel();
kmm2 = job2.get();
job2.remove();
}
try {
Assert.assertTrue(Arrays.deepEquals(kmm1._output._quantiles, kmm2._output._quantiles));
} finally {
if (kmm1 != null)
kmm1.delete();
if (kmm2 != null)
kmm2.delete();
}
}
} finally {
if (fr1 != null)
fr1.remove();
if (fr2 != null)
fr2.remove();
}
}
use of water.Job in project h2o-3 by h2oai.
the class QuantileTest method testWeights0.
@Test
public void testWeights0() {
QuantileModel kmm1;
QuantileModel kmm2;
Frame fr1 = null;
Frame fr2 = null;
try {
fr1 = parse_test_file("smalldata/junit/no_weights.csv");
fr2 = parse_test_file("smalldata/junit/weights_all_ones.csv");
for (QuantileModel.CombineMethod comb : new QuantileModel.CombineMethod[] { QuantileModel.CombineMethod.AVERAGE, QuantileModel.CombineMethod.LOW, QuantileModel.CombineMethod.HIGH, QuantileModel.CombineMethod.INTERPOLATE }) {
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr1._key;
parms._combine_method = comb;
parms._weights_column = null;
Job<QuantileModel> job1 = new Quantile(parms).trainModel();
kmm1 = job1.get();
job1.remove();
}
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr2._key;
parms._combine_method = comb;
parms._weights_column = "weight";
Job<QuantileModel> job2 = new Quantile(parms).trainModel();
kmm2 = job2.get();
job2.remove();
}
try {
Assert.assertTrue(Arrays.deepEquals(kmm1._output._quantiles, kmm2._output._quantiles));
} finally {
if (kmm1 != null)
kmm1.delete();
if (kmm2 != null)
kmm2.delete();
}
}
} finally {
if (fr1 != null)
fr1.remove();
if (fr2 != null)
fr2.remove();
}
}
use of water.Job in project h2o-3 by h2oai.
the class QuantileTest method testShuffled.
@Test
public void testShuffled() {
QuantileModel kmm1;
QuantileModel kmm2;
Frame fr1 = null;
Frame fr2 = null;
try {
fr1 = parse_test_file("smalldata/junit/no_weights.csv");
fr2 = parse_test_file("smalldata/junit/no_weights_shuffled.csv");
for (QuantileModel.CombineMethod comb : new QuantileModel.CombineMethod[] { QuantileModel.CombineMethod.AVERAGE, QuantileModel.CombineMethod.LOW, QuantileModel.CombineMethod.HIGH, QuantileModel.CombineMethod.INTERPOLATE }) {
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr1._key;
parms._combine_method = comb;
Job<QuantileModel> job1 = new Quantile(parms).trainModel();
kmm1 = job1.get();
job1.remove();
}
{
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = fr2._key;
parms._combine_method = comb;
Job<QuantileModel> job2 = new Quantile(parms).trainModel();
kmm2 = job2.get();
job2.remove();
}
try {
Assert.assertTrue(Arrays.deepEquals(kmm1._output._quantiles, kmm2._output._quantiles));
} finally {
if (kmm1 != null)
kmm1.delete();
if (kmm2 != null)
kmm2.delete();
}
}
} finally {
if (fr1 != null)
fr1.remove();
if (fr2 != null)
fr2.remove();
}
}
Aggregations