instanceInfo = new Instances(instanceInfo, 0);
  public boolean setInputFormat(Instances instanceInfo) throws Exception {    super.setInputFormat(instanceInfo);    if (m_AttributeSet == -1) {      m_Attribute = instanceInfo.numAttributes() - 1;    } else {      m_Attribute = m_AttributeSet;    }    if (!isNumeric() && !isNominal()) {      throw new UnsupportedAttributeTypeException("Can only handle numeric or nominal attributes.");    }    m_Values.setUpper(instanceInfo.attribute(m_Attribute).numValues() - 1);    if (isNominal() && m_ModifyHeader) {      Attribute oldAtt = instanceInfo.attribute(m_Attribute);      int [] selection = m_Values.getSelection();      FastVector newVals = new FastVector();      for (int i = 0; i < selection.length; i++) {	newVals.addElement(oldAtt.value(selection[i]));      }      instanceInfo.deleteAttributeAt(m_Attribute);      instanceInfo.insertAttributeAt(new Attribute(oldAtt.name(), newVals),				      m_Attribute);      m_NominalMapping = new int [oldAtt.numValues()];      for (int i = 0; i < m_NominalMapping.length; i++) {	boolean found = false;	for (int j = 0; j < selection.length; j++) {	  if (selection[j] == i) {	    m_NominalMapping[i] = j;	    found = true;	    break;	  }	}	if (!found) {	  m_NominalMapping[i] = -1;	}      }    }    setOutputFormat(instanceInfo);    return true;  }