public void testRegression() throws Exception {

    PMMLClassifier classifier = null;
    Instances testData = null;
    EvaluationUtils evalUtils = null; 
    weka.test.Regression reg = new weka.test.Regression(this.getClass());

    FastVector predictions = null;
    boolean success = false;
    for (int i = 0; i < m_modelNames.size(); i++) {
      classifier = getClassifier((String)m_modelNames.elementAt(i));
      testData = getData((String)m_dataSetNames.elementAt(i));
      evalUtils = new EvaluationUtils();

      try {
        String  className = classifier.getMiningSchema().getFieldsAsInstances().classAttribute().name();
        Attribute classAtt = testData.attribute(className);
        testData.setClass(classAtt);
        predictions = evalUtils.getTestPredictions(classifier, testData);
        success = true;
        String predsString = weka.classifiers.AbstractClassifierTest.predictionsToString(predictions);
        reg.println(predsString);
      } catch (Exception ex) {
        ex.printStackTrace();
        String msg = ex.getMessage().toLowerCase();
        if (msg.indexOf("not in classpath") > -1) {
          return;
        }
      }
    }

    if (!success) {
      fail("Problem during regression testing: no successful predictions generated");
    }

    try {
      String diff = reg.diff();
      if (diff == null) {
        System.err.println("Warning: No reference available, creating."); 
      } else if (!diff.equals("")) {
        fail("Regression test failed. Difference:\n" + diff);
      }
    }  catch (java.io.IOException ex) {
      fail("Problem during regression testing.\n" + ex);
    }    
  }