double evaluateInstanceLeaveOneOut(Instance instance, double [] instA)
  throws Exception {

    DecisionTableHashKey thekey;
    double [] tempDist;
    double [] normDist;

    thekey = new DecisionTableHashKey(instA);

    // if this one is not in the table
    if ((tempDist = (double [])m_entries.get(thekey)) == null) {
      throw new Error("This should never happen!");
    } else {
      normDist = new double [tempDist.length];
      System.arraycopy(tempDist,0,normDist,0,tempDist.length);
      normDist[(int)instance.classValue()] -= instance.weight();

      // update the table
      // first check to see if the class counts are all zero now
      boolean ok = false;
      for (int i=0;i<normDist.length;i++) {
	if (Utils.gr(normDist[i],1.0)) {
	  ok = true;
	  break;
	}
      }

      // downdate the class prior counts
      m_classPriorCounts[(int)instance.classValue()] -= 
	instance.weight(); 
      double [] classPriors = m_classPriorCounts.clone();
      Utils.normalize(classPriors);
      if (!ok) { // majority class	
	normDist = classPriors;
      } else {
	Utils.normalize(normDist);
      }

      m_classPriorCounts[(int)instance.classValue()] += 
      instance.weight();

      if (m_NB != null){
	// downdate NaiveBayes

	instance.setWeight(-instance.weight());
	m_NB.updateClassifier(instance);
	double [] nbDist = m_NB.distributionForInstance(instance);
	instance.setWeight(-instance.weight());
	m_NB.updateClassifier(instance);

	for (int i = 0; i < normDist.length; i++) {
	  normDist[i] = (Math.log(normDist[i]) - Math.log(classPriors[i]));
	  normDist[i] += Math.log(nbDist[i]);
	}
	normDist = Utils.logs2probs(normDist);
	// Utils.normalize(normDist);
      }

      if (m_evaluationMeasure == EVAL_AUC) {
	m_evaluation.evaluateModelOnceAndRecordPrediction(normDist, instance);						
      } else {
	m_evaluation.evaluateModelOnce(normDist, instance);
      }
      return Utils.maxIndex(normDist);
    }
  }