public void doRun(int run) throws Exception {

    if (getRawOutput()) {
      if (m_ZipDest == null) {
	m_ZipDest = new OutputZipper(m_OutputFile);
      }
    }

    if (m_Instances == null) {
      throw new Exception("No Instances set");
    }

    // Compute run and fold number from given run
    int fold = (run - 1) % m_NumFolds;
    run = ((run - 1) / m_NumFolds) + 1; 
    

    // Randomize on a copy of the original dataset
    Instances runInstances = new Instances(m_Instances);
    Random random = new Random(run);
    runInstances.randomize(random);
    if (runInstances.classAttribute().isNominal()) {
      runInstances.stratify(m_NumFolds);
    }

    // Add in some fields to the key like run and fold number, dataset name
    Object [] seKey = m_SplitEvaluator.getKey();
    Object [] key = new Object [seKey.length + 3];
    key[0] =  Utils.backQuoteChars(m_Instances.relationName());
    key[1] = "" + run;
    key[2] = "" + (fold + 1);
    System.arraycopy(seKey, 0, key, 3, seKey.length);
    if (m_ResultListener.isResultRequired(this, key)) {
      Instances train = runInstances.trainCV(m_NumFolds, fold, random);
      Instances test = runInstances.testCV(m_NumFolds, fold);
      try {
        Object [] seResults = m_SplitEvaluator.getResult(train, test);
        Object [] results = new Object [seResults.length + 1];
        results[0] = getTimestamp();
        System.arraycopy(seResults, 0, results, 1,
                         seResults.length);
        if (m_debugOutput) {
          String resultName = (""+run+"."+(fold+1)+"."
                               + Utils.backQuoteChars(runInstances.relationName())
                               +"."
                               +m_SplitEvaluator.toString()).replace(' ','_');
          resultName = Utils.removeSubstring(resultName, 
                                             "weka.classifiers.");
          resultName = Utils.removeSubstring(resultName, 
                                             "weka.filters.");
          resultName = Utils.removeSubstring(resultName, 
                                             "weka.attributeSelection.");
          m_ZipDest.zipit(m_SplitEvaluator.getRawResultOutput(), resultName);
        }
        m_ResultListener.acceptResult(this, key, results);
      } catch (Exception ex) {
        // Save the train and test datasets for debugging purposes?
        throw ex;
      }
    }
  }