Program: 117198
Project: 117198
Buggy source:
/** 
 * <p> <pre> Usage: mltk.predictor.gam.GA2MLearner -t	train set path -i	input model path -I	list of pairwise interactions path -m	maximum number of iterations [-g]	task between classification (c) and regression (r) (default: r) [-v]	valid set path [-e]	evaluation metric (default: default metric of task) [-r]	attribute file path [-o]	output model path [-V]	verbose (default: true) [-b]	bagging iterations (default: 100) [-s]	seed of the random number generator (default: 0) [-l]	learning rate (default: 0.01) </pre> </p>
 * @param args the command line arguments.
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
  Options opts=new Options();
  CmdLineParser parser=new CmdLineParser(GA2MLearner.class,opts);
  Task task=null;
  Metric metric=null;
  try {
    parser.parse(args);
    task=Task.get(opts.task);
    if (opts.metric == null) {
      metric=task.getDefaultMetric();
    }
 else {
      metric=MetricFactory.getMetric(opts.metric);
    }
  }
 catch (  IllegalArgumentException e) {
    parser.printUsage();
    System.exit(1);
  }
  Random.getInstance().setSeed(opts.seed);
  Instances trainSet=InstancesReader.read(opts.attPath,opts.trainPath);
  List<IntPair> terms=new ArrayList<>();
  BufferedReader br=new BufferedReader(new FileReader(opts.interactionsPath));
  for (; ; ) {
    String line=br.readLine();
    if (line == null) {
      break;
    }
    String[] data=line.split("String_Node_Str");
    IntPair term=new IntPair(Integer.parseInt(data[0]),Integer.parseInt(data[1]));
    terms.add(term);
  }
  br.close();
  GAM gam=PredictorReader.read(opts.inputModelPath,GAM.class);
  GA2MLearner learner=new GA2MLearner();
  learner.setBaggingIters(opts.baggingIters);
  learner.setGAM(gam);
  learner.setMaxNumIters(opts.maxNumIters);
  learner.setTask(task);
  learner.setMetric(metric);
  learner.setPairs(terms);
  learner.setLearningRate(opts.learningRate);
  learner.setVerbose(opts.verbose);
  if (opts.validPath != null) {
    Instances validSet=InstancesReader.read(opts.attPath,opts.validPath);
    learner.setValidSet(validSet);
  }
  long start=System.currentTimeMillis();
  learner.build(trainSet);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (end - start) / 1000.0);
  if (opts.outputModelPath != null) {
    PredictorWriter.write(gam,opts.outputModelPath);
  }
}

Fixed version (ground truth):
/** 
 * Trains a GA2M. <pre> Usage: mltk.predictor.gam.GA2MLearner -t	train set path -i	input model path -I	list of pairwise interactions path -m	maximum number of iterations [-g]	task between classification (c) and regression (r) (default: r) [-v]	valid set path [-e]	evaluation metric (default: default metric of task) [-r]	attribute file path [-o]	output model path [-V]	verbose (default: true) [-b]	bagging iterations (default: 100) [-s]	seed of the random number generator (default: 0) [-l]	learning rate (default: 0.01) </pre>
 * @param args the command line arguments.
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
  Options opts=new Options();
  CmdLineParser parser=new CmdLineParser(GA2MLearner.class,opts);
  Task task=null;
  Metric metric=null;
  try {
    parser.parse(args);
    task=Task.get(opts.task);
    if (opts.metric == null) {
      metric=task.getDefaultMetric();
    }
 else {
      metric=MetricFactory.getMetric(opts.metric);
    }
  }
 catch (  IllegalArgumentException e) {
    parser.printUsage();
    System.exit(1);
  }
  Random.getInstance().setSeed(opts.seed);
  Instances trainSet=InstancesReader.read(opts.attPath,opts.trainPath);
  List<IntPair> terms=new ArrayList<>();
  BufferedReader br=new BufferedReader(new FileReader(opts.interactionsPath));
  for (; ; ) {
    String line=br.readLine();
    if (line == null) {
      break;
    }
    String[] data=line.split("String_Node_Str");
    IntPair term=new IntPair(Integer.parseInt(data[0]),Integer.parseInt(data[1]));
    terms.add(term);
  }
  br.close();
  GAM gam=PredictorReader.read(opts.inputModelPath,GAM.class);
  GA2MLearner learner=new GA2MLearner();
  learner.setBaggingIters(opts.baggingIters);
  learner.setGAM(gam);
  learner.setMaxNumIters(opts.maxNumIters);
  learner.setTask(task);
  learner.setMetric(metric);
  learner.setPairs(terms);
  learner.setLearningRate(opts.learningRate);
  learner.setVerbose(opts.verbose);
  if (opts.validPath != null) {
    Instances validSet=InstancesReader.read(opts.attPath,opts.validPath);
    learner.setValidSet(validSet);
  }
  long start=System.currentTimeMillis();
  learner.build(trainSet);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (end - start) / 1000.0);
  if (opts.outputModelPath != null) {
    PredictorWriter.write(gam,opts.outputModelPath);
  }
}