Package bt.test

Source Code of bt.test.TestOfBayesianTest

package bt.test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import bt.BayesianTest;
import bt.Dataset;

public class TestOfBayesianTest {
  public static void main(String[] args) {
    String fullPathToDataset = "data/example4BinaryVariables.csv";
    int maxNumberOfExamples = 10; // read only first 10 examples
    Dataset dataset = new Dataset(maxNumberOfExamples, Dataset.getBinaryDomain(4));
    try {
      dataset = dataset.readDataset(new java.io.File(fullPathToDataset), maxNumberOfExamples, 1);
      List<Integer> x = new ArrayList<Integer>();
      x.add(0);
      List<Integer> y = new ArrayList<Integer>();
      y.add(1);
      List<Integer> z = new ArrayList<Integer>();
      z.add(2);
      z.add(3);
      BayesianTest bt = new BayesianTest();
      bt.independent(dataset, x, y, z);
      System.out.println("loglikelihoods: " + bt.getLoglikelihoods()[0] + " , " + bt.getLoglikelihoods()[1]);
      System.out.println("logprobs  : " + bt.getLogProbs()[0] + " , " + bt.getLogProbs()[1]);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}
TOP

Related Classes of bt.test.TestOfBayesianTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.