/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui;

import dbn.FlowManager;
import dbn.PredictionManager;
import dbn.LearningManager;
import dbn.classifier.neural.DBLearner;
import dbn.data.OptionsHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;

/**
 *
 * @author evripidis
 */
public class PredictionManagerTest {
    
    public PredictionManagerTest() {
    }

    /**
     * Test of TestData method, of class PredictionManager.
     */
    @Test
    public void testTestData() {
        System.out.println("TestData");
        try {
            String[] opts = {
                //"-load", "DATA/bibtex.dbn",
                "-path", "D:/Documents/Dropbox/University/Aristotle University of Thessaloniki/Πτυχιακή/data/bibtex - sparse/",
                "-train", "bibtex-train.arff",
                "-test", "bibtex-test.arff",
                "-info", "bibtex.xml",
                "-e", "1",
                "-debug",
                "-l", "1836", "500", "800", "159"
            };
            OptionsHandler oh = FlowManager.ParseArguments(opts);
            LearningManager lm = new LearningManager();
            lm.SetLearnerParameters(oh);
            lm.startLearning();
            DBLearner learner = (DBLearner) lm.getLearner();
            dbn.data.DBNFile.SaveToFile(learner.getLeanedDBN(), "DATA/bibtex.dbn");
            PredictionManager instance = new PredictionManager();
            long duration = instance.TestData(new DBLearner(), oh.getTestSet());
            System.out.println("Testing data in " + FlowManager.FormatMilliseconds(duration));
        } catch (Exception ex) {
            Logger.getLogger(PredictionManagerTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
