Program: 32900
Project: 32900
Buggy source:
public IMLGBLabelIsotonicScaling(IMLGradientBoosting imlGradientBoosting,MultiLabelClfDataSet multiLabelClfDataSet){
  this.imlGradientBoosting=imlGradientBoosting;
  this.isotonicRegressionList=new ArrayList<>();
  for (int l=0; l < imlGradientBoosting.getNumClasses(); l++) {
    final int calssIndex=l;
    final int numBuckets=10000;
    double bucketLength=1.0 / numBuckets;
    double[] locations=new double[numBuckets];
    for (int j=0; j < numBuckets; j++) {
      locations[j]=j * bucketLength + 0.5 * bucketLength;
    }
    BucketInfo empty=new BucketInfo(numBuckets);
    BucketInfo total;
    total=IntStream.range(0,multiLabelClfDataSet.getNumDataPoints()).parallel().mapToObj(i -> {
      double prob=imlGradientBoosting.predictClassProb(multiLabelClfDataSet.getRow(i),calssIndex);
      double[] count=new double[numBuckets];
      double[] sum=new double[numBuckets];
      double[] sumProbs=new double[numBuckets];
      int index=(int)Math.floor(prob / bucketLength);
      if (index < 0) {
        index=0;
      }
      if (index >= numBuckets) {
        index=numBuckets - 1;
      }
      count[index]+=1;
      sumProbs[index]+=prob;
      if (multiLabelClfDataSet.getMultiLabels()[i].matchClass(calssIndex)) {
        sum[index]+=1;
      }
 else {
        sum[index]+=0;
      }
      return new BucketInfo(count,sum,sumProbs);
    }
).reduce(empty,BucketInfo::add,BucketInfo::add);
    double[] counts=total.counts;
    double[] sums=total.sums;
    double[] accs=new double[counts.length];
    for (int k=0; k < counts.length; k++) {
      if (counts[k] != 0) {
        accs[k]=sums[k] / counts[k];
      }
    }
    IsotonicRegression isotonicRegression=new IsotonicRegression(locations,accs,counts);
    isotonicRegressionList.add(isotonicRegression);
  }
}

Fixed version (ground truth):
public IMLGBLabelIsotonicScaling(IMLGradientBoosting imlGradientBoosting,MultiLabelClfDataSet multiLabelClfDataSet){
  this.imlGradientBoosting=imlGradientBoosting;
  this.isotonicRegressionList=new ArrayList<>();
  for (int l=0; l < imlGradientBoosting.getNumClasses(); l++) {
    final int calssIndex=l;
    final int numBuckets=10000;
    double bucketLength=1.0 / numBuckets;
    double[] locations=new double[numBuckets];
    for (int j=0; j < numBuckets; j++) {
      locations[j]=j * bucketLength + 0.5 * bucketLength;
    }
    BucketInfo empty=new BucketInfo(numBuckets);
    BucketInfo total;
    total=IntStream.range(0,multiLabelClfDataSet.getNumDataPoints()).parallel().mapToObj(i -> {
      double prob=imlGradientBoosting.predictClassProb(multiLabelClfDataSet.getRow(i),calssIndex);
      double[] count=new double[numBuckets];
      double[] sum=new double[numBuckets];
      double[] sumProbs=new double[numBuckets];
      int index=(int)Math.floor(prob / bucketLength);
      if (index < 0) {
        index=0;
      }
      if (index >= numBuckets) {
        index=numBuckets - 1;
      }
      count[index]+=1;
      sumProbs[index]+=prob;
      if (multiLabelClfDataSet.getMultiLabels()[i].matchClass(calssIndex)) {
        sum[index]+=1;
      }
 else {
        sum[index]+=0;
      }
      return new BucketInfo(count,sum,sumProbs);
    }
).collect(() -> new BucketInfo(numBuckets),BucketInfo::addAll,BucketInfo::addAll);
    double[] counts=total.counts;
    double[] sums=total.sums;
    double[] accs=new double[counts.length];
    for (int k=0; k < counts.length; k++) {
      if (counts[k] != 0) {
        accs[k]=sums[k] / counts[k];
      }
    }
    IsotonicRegression isotonicRegression=new IsotonicRegression(locations,accs,counts);
    isotonicRegressionList.add(isotonicRegression);
  }
}