if (newData.numInstances() == 0) { throw new Exception("No training instances without missing class!"); }
  public void buildClassifier(Instances data) throws Exception {    if (m_BaseClassifierNames == null) {      throw new Exception("No base learners have been set");    }    if (m_MetaClassifierName == null) {      throw new Exception("No meta learner has been set");    }    if (!(data.classAttribute().isNominal() ||	  data.classAttribute().isNumeric())) {      throw new Exception("Class attribute has to be nominal or numeric!");    }    Instances newData = new Instances(data);    m_BaseFormat = new Instances(data, 0);    newData.deleteWithMissingClass();    newData.randomize(new Random(m_Seed));    if (newData.classAttribute().isNominal())      newData.stratify(m_NumFolds);    int numClassifiers = m_BaseClassifierNames.size();    m_BaseClassifiers = new FastVector(m_BaseClassifierNames.size());    for (int i = 0; i < numClassifiers; i++) {      // Instantiate the base classifiers      String learnerName = (String) m_BaseClassifierNames.elementAt(i);      Classifier currentClassifier = (Classifier)Class.forName(learnerName)	.newInstance();      if (currentClassifier instanceof OptionHandler) {	String [] options = Utils.splitOptions((String)m_BaseClassifierOptions					 .elementAt(i));	((OptionHandler)currentClassifier).setOptions(options);      }      m_BaseClassifiers.addElement(currentClassifier);    }    // Create meta data    Instances metaData = metaFormat(newData);    m_MetaFormat = new Instances(metaData, 0);    for (int j = 0; j < m_NumFolds; j++) {      Instances train = newData.trainCV(m_NumFolds, j);      // Build base classifiers      Enumeration enum = m_BaseClassifiers.elements();      while (enum.hasMoreElements()) {	Classifier currentClassifier = (Classifier) enum.nextElement();	currentClassifier.buildClassifier(train);      }      // Classify test instances and add to meta data      Instances test = newData.testCV(m_NumFolds, j);      for (int i = 0; i < test.numInstances(); i++) {	metaData.add(metaInstance(test.instance(i)));      }    }