Program: 117199
Project: 117199
Buggy source:
/** 
 * <p> <pre> Usage: mltk.predictor.gam.GAMLearner -t	train set 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]	base learner (default: tr:3: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(GAMLearner.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);
  GAMLearner learner=new GAMLearner();
  learner.setBaseLearner(opts.baseLearner);
  learner.setMaxNumIters(opts.maxNumIters);
  learner.setLearningRate(opts.learningRate);
  learner.setTask(task);
  learner.setMetric(metric);
  learner.setVerbose(opts.verbose);
  if (opts.validPath != null) {
    Instances validSet=InstancesReader.read(opts.attPath,opts.validPath);
    learner.setValidSet(validSet);
  }
  long start=System.currentTimeMillis();
  GAM gam=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 GAM. <pre> Usage: mltk.predictor.gam.GAMLearner -t	train set 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]	base learner (default: tr:3: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(GAMLearner.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);
  GAMLearner learner=new GAMLearner();
  learner.setBaseLearner(opts.baseLearner);
  learner.setMaxNumIters(opts.maxNumIters);
  learner.setLearningRate(opts.learningRate);
  learner.setTask(task);
  learner.setMetric(metric);
  learner.setVerbose(opts.verbose);
  if (opts.validPath != null) {
    Instances validSet=InstancesReader.read(opts.attPath,opts.validPath);
    learner.setValidSet(validSet);
  }
  long start=System.currentTimeMillis();
  GAM gam=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);
  }
}