throw new Exception("No instances without missing class values in training file!");
throw new IllegalArgumentException("No instances without missing " + "class values in training file!"); }  if (instances.numAttributes() == 1) { throw new IllegalArgumentException("Attribute missing. Need at least one " + "attribute other than class attribute!");
  public void buildClassifier(Instances instances) throws Exception {        double bestVal = Double.MAX_VALUE, currVal;    double bestPoint = -Double.MAX_VALUE, sum;    int bestAtt = -1, numClasses;    if (instances.checkForStringAttributes()) {      throw new UnsupportedAttributeTypeException("Can't handle string attributes!");    }    double[][] bestDist = new double[3][instances.numClasses()];    m_Instances = new Instances(instances);    m_Instances.deleteWithMissingClass();    if (m_Instances.numInstances() == 0) {      throw new Exception("No instances without missing class values in training file!");    }    if (m_Instances.classAttribute().isNominal()) {      numClasses = m_Instances.numClasses();    } else {      numClasses = 1;    }    // For each attribute    boolean first = true;    for (int i = 0; i < m_Instances.numAttributes(); i++) {      if (i != m_Instances.classIndex()) {	// Reserve space for distribution.	m_Distribution = new double[3][numClasses];	// Compute value of criterion for best split on attribute	if (m_Instances.attribute(i).isNominal()) {	  currVal = findSplitNominal(i);	} else {	  currVal = findSplitNumeric(i);	}	if ((first) || (currVal < bestVal)) {	  bestVal = currVal;	  bestAtt = i;	  bestPoint = m_SplitPoint;	  for (int j = 0; j < 3; j++) {	    System.arraycopy(m_Distribution[j], 0, bestDist[j], 0, 			     numClasses);	  }	}		// First attribute has been investigated	first = false;      }    }        // Set attribute, split point and distribution.    m_AttIndex = bestAtt;    m_SplitPoint = bestPoint;    m_Distribution = bestDist;    if (m_Instances.classAttribute().isNominal()) {      for (int i = 0; i < m_Distribution.length; i++) {	double sumCounts = Utils.sum(m_Distribution[i]);	if (sumCounts == 0) { // This means there were only missing attribute values	  System.arraycopy(m_Distribution[2], 0, m_Distribution[i], 0, 			   m_Distribution[2].length);	  Utils.normalize(m_Distribution[i]);	} else {	  Utils.normalize(m_Distribution[i], sumCounts); 	}      }    }        // Save memory    m_Instances = new Instances(m_Instances, 0);  }