Double value = new Double(dv);  result[current++] = value;
if (!Instance.isMissingValue(dv)) { Double value = new Double(dv); result[current++] = value; } else { result[current++] = null; }
  public Object [] getResult(Instances train, Instances test)     throws Exception {    if (train.classAttribute().type() != Attribute.NOMINAL) {      throw new Exception("Class attribute is not nominal!");    }    if (m_Template == null) {      throw new Exception("No classifier has been specified");    }    int addm = (m_AdditionalMeasures != null)       ? m_AdditionalMeasures.length       : 0;    Object [] result = new Object[RESULT_SIZE+addm];    String costName = train.relationName() + CostMatrix.FILE_EXTENSION;    File costFile = new File(getOnDemandDirectory(), costName);    if (!costFile.exists()) {      throw new Exception("On-demand cost file doesn't exist: " + costFile);    }    CostMatrix costMatrix = new CostMatrix(new BufferedReader(                                           new FileReader(costFile)));    Evaluation eval = new Evaluation(train, costMatrix);    m_Classifier = Classifier.makeCopy(m_Template);    m_Classifier.buildClassifier(train);    eval.evaluateModel(m_Classifier, test);    m_result = eval.toSummaryString();    // The results stored are all per instance -- can be multiplied by the    // number of instances to get absolute numbers    int current = 0;    result[current++] = new Double(eval.numInstances());    result[current++] = new Double(eval.correct());    result[current++] = new Double(eval.incorrect());    result[current++] = new Double(eval.unclassified());    result[current++] = new Double(eval.pctCorrect());    result[current++] = new Double(eval.pctIncorrect());    result[current++] = new Double(eval.pctUnclassified());    result[current++] = new Double(eval.totalCost());    result[current++] = new Double(eval.avgCost());    result[current++] = new Double(eval.meanAbsoluteError());    result[current++] = new Double(eval.rootMeanSquaredError());    result[current++] = new Double(eval.relativeAbsoluteError());    result[current++] = new Double(eval.rootRelativeSquaredError());    result[current++] = new Double(eval.SFPriorEntropy());    result[current++] = new Double(eval.SFSchemeEntropy());    result[current++] = new Double(eval.SFEntropyGain());    result[current++] = new Double(eval.SFMeanPriorEntropy());    result[current++] = new Double(eval.SFMeanSchemeEntropy());    result[current++] = new Double(eval.SFMeanEntropyGain());    // K&B stats    result[current++] = new Double(eval.KBInformation());    result[current++] = new Double(eval.KBMeanInformation());    result[current++] = new Double(eval.KBRelativeInformation());    if (m_Classifier instanceof Summarizable) {      result[current++] = ((Summarizable)m_Classifier).toSummaryString();    } else {      result[current++] = null;    }        for (int i=0;i<addm;i++) {      if (m_doesProduce[i]) {	try {	  double dv = ((AdditionalMeasureProducer)m_Classifier).	    getMeasure(m_AdditionalMeasures[i]);	  Double value = new Double(dv);	  result[current++] = value;	} catch (Exception ex) {	  System.err.println(ex);	}      } else {	result[current++] = null;      }    }    if (current != RESULT_SIZE+addm) {      throw new Error("Results didn't fit RESULT_SIZE");    }    return result;  }