public int logPrecision(int recall) {
    int totaltaken = 0;
    int rightIndex = numSamples() - 1; //next right candidate
    int leftIndex = 0; //next left candidate
    int totalcorrect = 0;

    while (totaltaken < recall) {
      double confr = Math.abs(scores[rightIndex] - .5);
      double confl = Math.abs(scores[leftIndex] - .5);
      int chosen = leftIndex;
      if (confr > confl) {
        chosen = rightIndex;
        rightIndex--;
      } else {
        leftIndex++;
      }
      //System.err.println("chose "+chosen+" score "+scores[chosen]+" class "+classes[chosen]+" correct "+correct(scores[chosen],classes[chosen]));
      if ((scores[chosen] >= .5) && (classes[chosen] == 1)) {
        totalcorrect++;
      }
      if ((scores[chosen] < .5) && (classes[chosen] == 0)) {
        totalcorrect++;
      }
      totaltaken++;
    }

    return totalcorrect;
  }
public int logPrecision ( int recall ) { int totaltaken = 0 ; int rightIndex = numSamples ( ) - 1 ; int leftIndex = 0 ; int totalcorrect = 0 ; while ( totaltaken < recall ) { double confr = Math . abs ( scores [ rightIndex ] - .5 ) ; double confl = Math . abs ( scores [ leftIndex ] - .5 ) ; int chosen = leftIndex ; if ( confr > confl ) { chosen = rightIndex ; rightIndex -- ; } else { leftIndex ++ ; } if ( ( scores [ chosen ] >= .5 ) && ( classes [ chosen ] == 1 ) ) { totalcorrect ++ ; } if ( ( scores [ chosen ] < .5 ) && ( classes [ chosen ] == 0 ) ) { totalcorrect ++ ; } totaltaken ++ ; } return totalcorrect ; }
what is the precision at this recall if we look at the score as the probability of class 1 given x
as if coming from logistic regression