Program: 21230
Project: 21230
Buggy source:
public static void main(String[] args) throws Exception {
  String dataPath="String_Node_Str";
  String dataTest="String_Node_Str";
  int ntopics=5;
  int niter=100;
  double threshold=0.1;
  int docsPerBatch=10;
  double learningRate=0.75;
  int timeLimit=-1;
  int dataSize=98851;
  int ncores=4;
  boolean amazon_cluster=true;
  if (args.length > 1) {
    dataPath=args[0];
    dataTest=args[1];
    dataSize=Integer.parseInt(args[2]);
    ntopics=Integer.parseInt(args[3]);
    niter=Integer.parseInt(args[4]);
    threshold=Double.parseDouble(args[5]);
    docsPerBatch=Integer.parseInt(args[6]);
    learningRate=Double.parseDouble(args[7]);
    timeLimit=Integer.parseInt(args[8]);
    ncores=Integer.parseInt(args[9]);
    amazon_cluster=Boolean.parseBoolean(args[10]);
  }
  final ExecutionEnvironment env;
  if (amazon_cluster) {
    env=ExecutionEnvironment.getExecutionEnvironment();
  }
 else {
    Configuration conf=new Configuration();
    conf.setInteger("String_Node_Str",12000);
    conf.setInteger("String_Node_Str",ncores);
    env=ExecutionEnvironment.createLocalEnvironment(conf);
    env.setParallelism(ncores);
  }
  DataFlink<DataInstance> dataInstances=DataFlinkLoader.loadDataFromFile(env,dataPath,false);
  StochasticVI svb=new StochasticVI();
  PlateauLDAFlink plateauLDA=new PlateauLDAFlink(dataInstances.getAttributes(),"String_Node_Str","String_Node_Str");
  plateauLDA.setNTopics(ntopics);
  svb.setPlateuStructure(plateauLDA);
  svb.setOutput(true);
  svb.setMaximumLocalIterations(niter);
  svb.setLocalThreshold(threshold);
  svb.setSeed(5);
  svb.setBatchSize(docsPerBatch);
  svb.setLearningFactor(learningRate);
  svb.setDataSetSize(dataSize);
  svb.setTimiLimit(timeLimit);
  svb.setDataFlink(dataInstances);
  svb.setBatchConverter(ConversionToBatches::toBatchesBySeqID);
  svb.runLearning();
  DataFlink<DataInstance> instancesTest=DataFlinkLoader.loadDataFromFile(env,dataTest,false);
  double test_log_likelihood=StochasticVI.computeELBO(instancesTest,svb.getSVB(),ConversionToBatches::toBatchesBySeqID);
  System.out.println("String_Node_Str" + test_log_likelihood);
  if (args.length > 0) {
    args[0]="String_Node_Str";
    args[1]="String_Node_Str";
  }
  String pathNetwork="String_Node_Str" + Arrays.toString(args) + "String_Node_Str";
  svb.getSVB().setDAG(((PlateauLDAFlink)svb.getSVB().getPlateuStructure()).getDagLDA());
  System.out.println(svb.getLearntBayesianNetwork().toString());
  BayesianNetworkWriter.saveToFile(svb.getLearntBayesianNetwork(),pathNetwork);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String dataPath="String_Node_Str";
  String dataTest="String_Node_Str";
  int ntopics=5;
  int niter=100;
  double threshold=0.1;
  int docsPerBatch=10;
  double learningRate=0.75;
  int timeLimit=-1;
  int dataSize=98851;
  int ncores=4;
  boolean amazon_cluster=true;
  if (args.length > 1) {
    dataPath=args[0];
    dataTest=args[1];
    dataSize=Integer.parseInt(args[2]);
    ntopics=Integer.parseInt(args[3]);
    niter=Integer.parseInt(args[4]);
    threshold=Double.parseDouble(args[5]);
    docsPerBatch=Integer.parseInt(args[6]);
    learningRate=Double.parseDouble(args[7]);
    timeLimit=Integer.parseInt(args[8]);
    ncores=Integer.parseInt(args[9]);
    amazon_cluster=Boolean.parseBoolean(args[10]);
  }
  final ExecutionEnvironment env;
  if (amazon_cluster) {
    env=ExecutionEnvironment.getExecutionEnvironment();
  }
 else {
    Configuration conf=new Configuration();
    conf.setInteger("String_Node_Str",12000);
    conf.setInteger("String_Node_Str",ncores);
    env=ExecutionEnvironment.createLocalEnvironment(conf);
    env.setParallelism(ncores);
  }
  DataFlink<DataInstance> dataInstances=DataFlinkLoader.loadDataFromFile(env,dataPath,false);
  StochasticVI svb=new StochasticVI();
  PlateauLDAFlink plateauLDA=new PlateauLDAFlink(dataInstances.getAttributes(),"String_Node_Str","String_Node_Str");
  plateauLDA.setNTopics(ntopics);
  svb.setPlateuStructure(plateauLDA);
  svb.setOutput(true);
  svb.setMaximumLocalIterations(niter);
  svb.setLocalThreshold(threshold);
  svb.setSeed(5);
  svb.setBatchSize(docsPerBatch);
  svb.setLearningFactor(learningRate);
  svb.setDataSetSize(dataSize);
  svb.setTimiLimit(timeLimit);
  svb.setDataFlink(dataInstances);
  svb.setBatchConverter(ConversionToBatches::toBatchesBySeqID);
  svb.runLearning();
  DataFlink<DataInstance> instancesTest=DataFlinkLoader.loadDataFromFile(env,dataTest,false);
  double test_log_likelihood=StochasticVI.computeELBO(instancesTest,svb.getSVB(),ConversionToBatches::toBatchesBySeqID);
  System.out.println("String_Node_Str" + test_log_likelihood);
  if (args.length > 0) {
    args[0]="String_Node_Str";
    args[1]="String_Node_Str";
  }
  String pathNetwork="String_Node_Str" + Arrays.toString(args) + "String_Node_Str";
  svb.getSVB().setDAG(((PlateauLDAFlink)svb.getSVB().getPlateuStructure()).getDagLDA());
  System.out.println(svb.getLearntBayesianNetwork().toString());
  BayesianNetworkWriter.save(svb.getLearntBayesianNetwork(),pathNetwork);
}