public static double P_PrecisionMacro(int Y[][],int Ypred[][]){
  int L=Y[0].length;
  double m=0.0;
  for (int j=0; j < L; j++) {
    int[] y_j=MatrixUtils.getCol(Y,j);
    int[] p_j=MatrixUtils.getCol(Ypred,j);
    if (allMissing(y_j)) {
      L--;
      continue;
    }
    int[][] aligned=align(y_j,p_j);
    int[] y_jAligned=aligned[0];
    int[] p_jAligned=aligned[1];
    double curPrec=P_Precision(y_jAligned,p_jAligned);
    if (Double.isNaN(curPrec)) {
      continue;
    }
    m+=curPrec;
  }
  return m / L;
}

public static double P_PrecisionMacro ( int Y [ ] [ ] , int Ypred [ ] [ ] ) { int L = Y [ 0 ] . length ; double m = 0.0 ; for ( int j = 0 ; j < L ; j ++ ) { int [ ] y_j = MatrixUtils . getCol ( Y , j ) ; int [ ] p_j = MatrixUtils . getCol ( Ypred , j ) ; if ( allMissing ( y_j ) ) { L -- ; continue ; } int [ ] [ ] aligned = align ( y_j , p_j ) ; int [ ] y_jAligned = aligned [ 0 ] ; int [ ] p_jAligned = aligned [ 1 ] ; double curPrec = P_Precision ( y_jAligned , p_jAligned ) ; if ( Double . isNaN ( curPrec ) ) { continue ; } m += curPrec ; } return m / L ; }
p_precision - ( retrieved and relevant ) / retrieved
