sumOfWeights += instance.weight();
  public void buildClassifier(Instances instances) throws Exception {    m_Class = instances.classAttribute();    m_ClassValue = 0;    switch (instances.classAttribute().type()) {    case Attribute.NUMERIC:      m_Counts = null;      break;    case Attribute.NOMINAL:      m_Counts = new double [instances.numClasses()];      for (int i = 0; i < m_Counts.length; i++) {	m_Counts[i] = 1;      }      break;    default:      throw new Exception("ZeroR can only handle nominal and numeric class"			  + " attributes.");    }    Enumeration enum = instances.enumerateInstances();    while (enum.hasMoreElements()) {      Instance instance = (Instance) enum.nextElement();      if (!instance.classIsMissing()) {	if (instances.classAttribute().isNominal()) {	  m_Counts[(int)instance.classValue()] += instance.weight();	} else {	  m_ClassValue += instance.weight() * instance.classValue();	}      }    }