double evaluateInstanceLeaveOneOut(Instance instance,double[] instA) throws Exception {
  DecisionTableHashKey thekey;
  double[] tempDist;
  double[] normDist;
  thekey=new DecisionTableHashKey(instA);
  if (m_classIsNominal) {
    if ((tempDist=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();
      boolean ok=false;
      for (      double element : normDist) {
        if (Utils.gr(element,1.0)) {
          ok=true;
          break;
        }
      }
      m_classPriorCounts[(int)instance.classValue()]-=instance.weight();
      double[] classPriors=m_classPriorCounts.clone();
      Utils.normalize(classPriors);
      if (!ok) {
        normDist=classPriors;
      }
      m_classPriorCounts[(int)instance.classValue()]+=instance.weight();
      Utils.normalize(normDist);
      if (m_evaluationMeasure == EVAL_AUC) {
        m_evaluation.evaluateModelOnceAndRecordPrediction(normDist,instance);
      }
 else {
        m_evaluation.evaluateModelOnce(normDist,instance);
      }
      return Utils.maxIndex(normDist);
    }
  }
 else {
    if ((tempDist=m_entries.get(thekey)) != null) {
      normDist=new double[tempDist.length];
      System.arraycopy(tempDist,0,normDist,0,tempDist.length);
      normDist[0]-=(instance.classValue() * instance.weight());
      normDist[1]-=instance.weight();
      if (Utils.eq(normDist[1],0.0)) {
        double[] temp=new double[1];
        temp[0]=m_majority;
        m_evaluation.evaluateModelOnce(temp,instance);
        return m_majority;
      }
 else {
        double[] temp=new double[1];
        temp[0]=normDist[0] / normDist[1];
        m_evaluation.evaluateModelOnce(temp,instance);
        return temp[0];
      }
    }
 else {
      throw new Error("This should never happen!");
    }
  }
}

double evaluateInstanceLeaveOneOut ( Instance instance , double [ ] instA ) throws Exception { DecisionTableHashKey thekey ; double [ ] tempDist ; double [ ] normDist ; thekey = new DecisionTableHashKey ( instA ) ; if ( m_classIsNominal ) { if ( ( tempDist = 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 ( ) ; boolean ok = false ; for ( double element : normDist ) { if ( Utils . gr ( element , 1.0 ) ) { ok = true ; break ; } } m_classPriorCounts [ ( int ) instance . classValue ( ) ] -= instance . weight ( ) ; double [ ] classPriors = m_classPriorCounts . clone ( ) ; Utils . normalize ( classPriors ) ; if ( ! ok ) { normDist = classPriors ; } m_classPriorCounts [ ( int ) instance . classValue ( ) ] += instance . weight ( ) ; Utils . normalize ( normDist ) ; if ( m_evaluationMeasure == EVAL_AUC ) { m_evaluation . evaluateModelOnceAndRecordPrediction ( normDist , instance ) ; } else { m_evaluation . evaluateModelOnce ( normDist , instance ) ; } return Utils . maxIndex ( normDist ) ; } } else { if ( ( tempDist = m_entries . get ( thekey ) ) != null ) { normDist = new double [ tempDist . length ] ; System . arraycopy ( tempDist , 0 , normDist , 0 , tempDist . length ) ; normDist [ 0 ] -= ( instance . classValue ( ) * instance . weight ( ) ) ; normDist [ 1 ] -= instance . weight ( ) ; if ( Utils . eq ( normDist [ 1 ] , 0.0 ) ) { double [ ] temp = new double [ 1 ] ; temp [ 0 ] = m_majority ; m_evaluation . evaluateModelOnce ( temp , instance ) ; return m_majority ; } else { double [ ] temp = new double [ 1 ] ; temp [ 0 ] = normDist [ 0 ] / normDist [ 1 ] ; m_evaluation . evaluateModelOnce ( temp , instance ) ; return temp [ 0 ] ; } } else { throw new Error ( "This should never happen!" ) ; } } }
classifies an instance for internal leave one out cross validation of feature sets
