newData = residualReplace(newData, nextC);
newData = residualReplace(newData, nextC, true);
  public void buildClassifier(Instances data) throws Exception {     m_additiveModels = new FastVector();    if (m_Classifier == null) {      throw new Exception("No base classifiers have been set!");    }    if (data.classAttribute().isNominal()) {      throw new UnsupportedClassTypeException("Class must be numeric!");    }    Instances newData = new Instances(data);    newData.deleteWithMissingClass();    m_classIndex = newData.classIndex();    double sum = 0;    double temp_sum = 0;    // Add the model for the mean first    ZeroR zr = new ZeroR();    zr.buildClassifier(newData);    m_additiveModels.addElement(zr);    newData = residualReplace(newData, zr);    for (int i = 0; i < newData.numInstances(); i++) {      sum += newData.instance(i).weight() *	newData.instance(i).classValue() *	newData.instance(i).classValue();    }    if (m_debug) {      System.err.println("Sum of squared residuals "			 +"(predicting the mean) : "+sum);    }    int modelCount = 0;    do {      temp_sum = sum;      Classifier nextC = Classifier.makeCopies(m_Classifier, 1)[0];      nextC.buildClassifier(newData);      m_additiveModels.addElement(nextC);      newData = residualReplace(newData, nextC);      sum = 0;      for (int i = 0; i < newData.numInstances(); i++) {	sum += newData.instance(i).weight() *	  newData.instance(i).classValue() *	  newData.instance(i).classValue();      }      if (m_debug) {	System.err.println("Sum of squared residuals : "+sum);      }      modelCount++;    } while (((temp_sum - sum) > Utils.SMALL) && 	     (m_maxModels > 0 ? (modelCount < m_maxModels) : true));  }