content: 
  package eu.amidst.core.examples.learning;
  
  
  import eu.amidst.core.datastream.DataInstance;
  import eu.amidst.core.datastream.DataStream;
  import eu.amidst.core.io.DataStreamLoader;
  import eu.amidst.core.learning.parametric.bayesian.ParallelSVB;
  import eu.amidst.core.models.BayesianNetwork;
  import eu.amidst.core.utils.DAGGenerator;
  
  /**
   *
   * This example shows how to learn the parameters of a Bayesian network from a stream of data with a Bayesian
   * approach using a **parallel** version of the following algorithm
   *
   * <i> Broderick, T., Boyd, N., Wibisono, A., Wilson, A. C., and Jordan, M. I. (2013). Streaming variational Bayes.
   * In Advances in Neural Information Processing Systems (pp. 1727-1735). </i>
   *
   *
   * Created by andresmasegosa on 18/6/15.
   */
  public class ParallelSVBExample {
  
      public static void main(String[] args) throws Exception {
  
          //We can open the data stream using the static class DataStreamLoader
          DataStream<DataInstance> data = DataStreamLoader.open("datasets/simulated/WasteIncineratorSample.arff");
  
          //We create a ParallelSVB object
          ParallelSVB parameterLearningAlgorithm = new ParallelSVB();
  
          //We fix the number of cores we want to exploit
          parameterLearningAlgorithm.setNCores(4);
  
          //We fix the DAG structure, which is a Naive Bayes with a global latent binary variable
          parameterLearningAlgorithm.setDAG(DAGGenerator.getHiddenNaiveBayesStructure(data.getAttributes(), "H", 2));
  
          //We fix the size of the window
          parameterLearningAlgorithm.getSVBEngine().setWindowsSize(100);
  
          //We can activate the output
          parameterLearningAlgorithm.setOutput(true);
  
          //We set the data which is going to be used for leaning the parameters
          parameterLearningAlgorithm.setDataStream(data);
  
          //We perform the learning
          parameterLearningAlgorithm.runLearning();
  
          //And we get the model
          BayesianNetwork bnModel = parameterLearningAlgorithm.getLearntBayesianNetwork();
  
          //We print the model
          System.out.println(bnModel.toString());
  
      }
  
  }
  