if (data.numInstances() == 0) { throw new Exception("No instances without missing class values in training file!");
if (filteredData.numInstances() == 0) { throw new Exception("No instances in training file!");
  public void buildClassifier(Instances data) throws Exception{	    // Check for non-nominal classes    if (!data.classAttribute().isNominal()) {      throw new UnsupportedClassTypeException("Nominal class, please.");    }    Instances filteredData = new Instances(data);    filteredData.deleteWithMissingClass();    if (data.numInstances() == 0) {      throw new Exception("No instances without missing class values in training file!");    }    //replace missing values    m_replaceMissing = new ReplaceMissingValues();    m_replaceMissing.setInputFormat(filteredData);	    filteredData = Filter.useFilter(filteredData, m_replaceMissing);		    //possibly convert nominal attributes globally    if (m_convertNominal) {	          m_nominalToBinary = new NominalToBinary();      m_nominalToBinary.setInputFormat(filteredData);	      filteredData = Filter.useFilter(filteredData, m_nominalToBinary);    }    int minNumInstances = 2;	    //create ModelSelection object, either for splits on the residuals or for splits on the class value     ModelSelection modSelection;	    if (m_splitOnResiduals) {      modSelection = new ResidualModelSelection(minNumInstances);    } else {      modSelection = new C45ModelSelection(minNumInstances, filteredData);    }	    //create tree root    m_tree = new LMTNode(modSelection, m_numBoostingIterations, m_fastRegression, 			 m_errorOnProbabilities, m_minNumInstances);    //build tree    m_tree.buildClassifier(filteredData);    if (modSelection instanceof C45ModelSelection) ((C45ModelSelection)modSelection).cleanup();  }