Search in sources :

Example 6 with Job

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;
}
Also used : Job(water.Job) DeepLearningModel(hex.deeplearning.DeepLearningModel)

Example 7 with Job

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();
    }
}
Also used : Frame(water.fvec.Frame) Job(water.Job) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 8 with Job

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();
    }
}
Also used : Frame(water.fvec.Frame) Job(water.Job) Test(org.junit.Test)

Example 9 with Job

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();
    }
}
Also used : Frame(water.fvec.Frame) Job(water.Job) Test(org.junit.Test)

Example 10 with Job

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();
    }
}
Also used : Frame(water.fvec.Frame) Job(water.Job) Test(org.junit.Test)

Aggregations

Job (water.Job)19 Frame (water.fvec.Frame)7 Test (org.junit.Test)5 Value (water.Value)3 JsonObject (dontweave.gson.JsonObject)2 Ignore (org.junit.Ignore)2 JsonArray (dontweave.gson.JsonArray)1 JsonElement (dontweave.gson.JsonElement)1 Model (hex.Model)1 NeuralNet (hex.NeuralNet)1 SplitFrame (hex.SplitFrame)1 DeepLearningModel (hex.deeplearning.DeepLearningModel)1 DRFModel (hex.drf.DRF.DRFModel)1 Quantile (hex.quantile.Quantile)1 QuantileModel (hex.quantile.QuantileModel)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Date (java.util.Date)1 Futures (water.Futures)1 Key (water.Key)1 MRTask (water.MRTask)1