public static double getMetric(Evaluation eval, int metric_index) {
    switch (metric_index) {
      case METRIC_ACCURACY:
	return eval.pctCorrect();
      case METRIC_RMSE:
	return 1.0 - eval.rootMeanSquaredError();
      case METRIC_ROC:
	return eval.areaUnderROC(1); //TODO - is 1 right?
      case METRIC_PRECISION:
	return eval.precision(1); //TODO - same question
      case METRIC_RECALL:
	return eval.recall(1); //TODO - same question
      case METRIC_FSCORE:
	return eval.fMeasure(1); //TODO - same question
      case METRIC_ALL:
	double average = 0;
	int num_metrics = 0;
	average += eval.pctCorrect();
	++num_metrics;
	average += 1.0 - eval.rootMeanSquaredError();
	++num_metrics;
	average += eval.areaUnderROC(1);
	++num_metrics;
	average += eval.precision(1);
	++num_metrics;
	average += eval.recall(1);
	++num_metrics;
	average += eval.fMeasure(1);
	++num_metrics;
	return average / num_metrics;
      default:
	return 0.0; //FIXME TODO - this should probably be an exception?
    }
  }