public static double[][] align(int[] real,double[] pred){
  int missing=numberOfMissingLabels(real);
  double[] _real=new double[real.length - missing];
  double[] _pred=new double[real.length - missing];
  int offset=0;
  for (int i=0; i < real.length; i++) {
    if (real[i] == -1 || pred[i] == -1.0 || Double.isNaN(pred[i])) {
      offset++;
      continue;
    }
    _real[i - offset]=real[i];
    _pred[i - offset]=pred[i];
  }
  double[][] res=new double[2][0];
  res[0]=_real;
  res[1]=_pred;
  return res;
}

public static double [ ] [ ] align ( int [ ] real , double [ ] pred ) { int missing = numberOfMissingLabels ( real ) ; double [ ] _real = new double [ real . length - missing ] ; double [ ] _pred = new double [ real . length - missing ] ; int offset = 0 ; for ( int i = 0 ; i < real . length ; i ++ ) { if ( real [ i ] == - 1 || pred [ i ] == - 1.0 || Double . isNaN ( pred [ i ] ) ) { offset ++ ; continue ; } _real [ i - offset ] = real [ i ] ; _pred [ i - offset ] = pred [ i ] ; } double [ ] [ ] res = new double [ 2 ] [ 0 ] ; res [ 0 ] = _real ; res [ 1 ] = _pred ; return res ; }
helper function for missing values in the labels and missing predictions ( i . e . , from abstaining classifiers ) . aligns the predictions with the real labels , discarding labels and predictions that are missing .
