m_Train = insts;
  public void buildClassifier(Instances insts) throws Exception {     if (insts.checkForStringAttributes()) {      throw new Exception("Can't handle string attributes!");    }    if (insts.numClasses() > 2) {      throw new Exception("Can only handle two-class datasets!");    }    if (insts.classAttribute().isNumeric()) {      throw new Exception("SMO can't handle a numeric class!");    }    // Filter data    m_ReplaceMissingValues = new ReplaceMissingValuesFilter();    m_ReplaceMissingValues.inputFormat(insts);    insts = Filter.useFilter(insts, m_ReplaceMissingValues);    m_NominalToBinary = new NominalToBinaryFilter();    m_NominalToBinary.inputFormat(insts);    insts = Filter.useFilter(insts, m_NominalToBinary);       /** Randomize training data */    m_Train = insts;    m_Train.randomize(new Random(m_Seed));    /** Make space to store perceptrons */    m_Additions = new int[m_MaxK + 1];    m_IsAddition = new boolean[m_MaxK + 1];    m_Weights = new int[m_MaxK + 1];    /** Compute perceptrons */    m_K = 0;  out:    for (int it = 0; it < m_NumIterations; it++) {      for (int i = 0; i < m_Train.numInstances(); i++) {	Instance inst = m_Train.instance(i);	int prediction = makePrediction(m_K, inst);	int classValue = (int) inst.classValue();	if (prediction == classValue) {	  m_Weights[m_K]++;	} else {	  m_IsAddition[m_K] = (classValue == 1);	  m_Additions[m_K] = i;	  m_K++;	  m_Weights[m_K]++;	}	if (m_K == m_MaxK) {	  break out;	}      }    }  }