public static void main(String[] args) throws Exception {
		Options opts = new Options();
		CmdLineParser parser = new CmdLineParser(LADBoostLearner.class, opts);
		Metric metric = null;
		TreeLearner rtLearner = null;
		try {
			parser.parse(args);
			if (opts.metric == null) {
				metric = new MAE();
			} else {
				metric = MetricFactory.getMetric(opts.metric);
			}
			rtLearner = BRTUtils.parseTreeLearner(opts.baseLearner);
		} catch (IllegalArgumentException e) {
			parser.printUsage();
			System.exit(1);
		}

		Random.getInstance().setSeed(opts.seed);

		Instances trainSet = InstancesReader.read(opts.attPath, opts.trainPath);

		LADBoostLearner learner = new LADBoostLearner();
		learner.setLearningRate(opts.learningRate);
		learner.setMaxNumIters(opts.maxNumIters);
		learner.setVerbose(opts.verbose);
		learner.setMetric(metric);
		learner.setTreeLearner(rtLearner);
		
		if (opts.validPath != null) {
			Instances validSet = InstancesReader.read(opts.attPath, opts.validPath);
			learner.setValidSet(validSet);
		}

		long start = System.currentTimeMillis();
		BRT brt = learner.build(trainSet);
		long end = System.currentTimeMillis();
		System.out.println("Time: " + (end - start) / 1000.0);

		if (opts.outputModelPath != null) {
			PredictorWriter.write(brt, opts.outputModelPath);
		}
	}