m_incrementalStructure = null;
  public void acceptClassifier(IncrementalClassifierEvent e) {    weka.classifiers.Classifier classifier = e.getClassifier();    Instance currentI = e.getCurrentInstance();    int status = e.getStatus();    int oldNumAtts = currentI.dataset().numAttributes();    if (status == IncrementalClassifierEvent.NEW_BATCH) {      m_instanceEvent = new InstanceEvent(this, null, 0);      // create new header structure      Instances oldStructure = new Instances(currentI.dataset(), 0);      String relationNameModifier = oldStructure.relationName()	+"_with predictions";       if (!m_appendProbabilities 	   || oldStructure.classAttribute().isNumeric()) {	 try {	   m_incrementalStructure = makeDataSetClass(oldStructure, classifier,						     relationNameModifier);	   m_instanceVals = new double [m_incrementalStructure.numAttributes()];	 } catch (Exception ex) {	   ex.printStackTrace();	   return;	 }       } else if (m_appendProbabilities) {	 try {	   m_incrementalStructure = 	     makeDataSetProbabilities(oldStructure, classifier,				      relationNameModifier);	   m_instanceVals = new double [m_incrementalStructure.numAttributes()];	 } catch (Exception ex) {	   ex.printStackTrace();	   return;	 }       }    }    Instance newInst;    try {      // process the actual instance      for (int i = 0; i < oldNumAtts; i++) {	m_instanceVals[i] = currentI.value(i);      }      if (!m_appendProbabilities 	  || currentI.dataset().classAttribute().isNumeric()) {	double predClass = 	  classifier.classifyInstance(currentI);	m_instanceVals[m_instanceVals.length - 1] = predClass;      } else if (m_appendProbabilities) {	double [] preds = classifier.distributionForInstance(currentI);	for (int i = oldNumAtts; i < m_instanceVals.length; i++) {	  m_instanceVals[i] = preds[i-oldNumAtts];	}            }          } catch (Exception ex) {      ex.printStackTrace();      return;    } finally {      newInst = new Instance(currentI.weight(), m_instanceVals);      newInst.setDataset(m_incrementalStructure);      m_instanceEvent.setInstance(newInst);      m_instanceEvent.setStatus(status);      // notify listeners      notifyInstanceAvailable(m_instanceEvent);    }    if (status == IncrementalClassifierEvent.BATCH_FINISHED) {      // clean up      m_incrementalStructure = null;      m_instanceVals = null;      m_instanceEvent = null;    }  }