@@ -0,0 +1,2205 @@
+package hex;%0A%0Aimport hex.nn.NN;%0Aimport hex.nn.NNModel;%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport water.JUnitRunnerDebug;%0Aimport water.Key;%0Aimport water.TestUtil;%0Aimport water.UKV;%0Aimport water.fvec.Frame;%0Aimport water.fvec.NFSFileVec;%0Aimport water.fvec.ParseDataset2;%0Aimport water.util.Log;%0A%0Apublic class NeuralNetProstateTest extends TestUtil %7B%0A  @BeforeClass public static void stall() %7B%0A    stall_till_cloudsize(JUnitRunnerDebug.NODES);%0A  %7D%0A%0A  @Test public void run() %7B%0A    Key file = NFSFileVec.make(find_test_file(%22smalldata/./logreg/prostate.csv%22));%0A    Frame frame = ParseDataset2.parse(Key.make(), new Key%5B%5D%7Bfile%7D);%0A%0A    Key dest = Key.make(%22prostate%22);%0A%0A    // build the model, with all kinds of shuffling/rebalancing/sampling%0A    %7B%0A      NN p = new NN();%0A      p.epochs = 1000;%0A      p.source = frame;%0A      p.response = frame.vecs()%5B1%5D;%0A      p.validation = frame;%0A      p.destination_key = dest;%0A%0A      // Leaky%0A//      p.force_load_balance = true;%0A//      p.balance_classes = true;%0A//      p.shuffle_training_data = true;%0A//      p.score_training_samples = 100;%0A//      p.score_validation_samples = 50;%0A//      NNModel mymodel = p.initModel();%0A//      p.trainModel(mymodel);%0A//      p.trainModel(mymodel);%0A//      p.delete();%0A%0A      // No leaks%0A      p.force_load_balance = false;%0A      p.balance_classes = false;%0A      p.shuffle_training_data = false;%0A      p.score_training_samples = 0;%0A      p.score_validation_samples = 0;%0A      p.execImpl();%0A    %7D%0A%0A    // score and check result%0A    %7B%0A      NNModel mymodel = UKV.get(dest); //this actually *requires* frame to also still be in UKV (because of DataInfo...)%0A      Frame pred = mymodel.score(frame);%0A      water.api.ConfusionMatrix CM = new water.api.ConfusionMatrix();%0A      CM.actual = frame;%0A      CM.vactual = frame.vecs()%5B1%5D;%0A      CM.predict = pred;%0A      CM.vpredict = pred.vecs()%5B0%5D;%0A      CM.serve();%0A      StringBuilder sb = new StringBuilder();%0A      double error = CM.toASCII(sb);%0A      Log.info(sb);%0A      if (error != 0) %7B%0A        Assert.fail(%22Classification error is not 0, but %22 + error + %22.%22);%0A      %7D%0A      pred.delete();%0A      mymodel.delete();%0A    %7D%0A%0A    frame.delete();%0A  %7D%0A%7D%0A

Add NN JUnit test for prostate data.