private static double score1static(Chunk[] chks, int treeIdx, double offset, double[] fs, int row, Distribution dist, int nClasses) {
    double f = chks[treeIdx].atd(row) + offset;
    double p = dist.linkInv(f);
    if (dist.distribution == DistributionFamily.modified_huber || dist.distribution == DistributionFamily.bernoulli || dist.distribution == DistributionFamily.quasibinomial) {
      fs[2] = p;
      fs[1] = 1.0 - p;
      return 1;                 // f2 = 1.0 - f1; so f1+f2 = 1.0
    } else if (dist.distribution == DistributionFamily.multinomial) {
      if (nClasses == 2) {
        // This optimization assumes the 2nd tree of a 2-class system is the
        // inverse of the first.  Fill in the missing tree
        fs[1] = p;
        fs[2] = 1 / p;
        return fs[1] + fs[2];
      }
      // Multinomial loss function; sum(exp(data)).  Load tree data
      assert (offset == 0);
      fs[1] = f;
      for (int k = 1; k < nClasses; k++)
        fs[k + 1] = chks[treeIdx + k].atd(row);
      // Rescale to avoid Infinities; return sum(exp(data))
      return hex.genmodel.GenModel.log_rescale(fs);
    } else {
      return fs[0] = p;
    }
  }
private static double score1static ( Chunk [ ] chks , int treeIdx , double offset , double [ ] fs , int row , Distribution dist , int nClasses ) { double f = chks [ treeIdx ] . atd ( row ) + offset ; double p = dist . linkInv ( f ) ; if ( dist . distribution == DistributionFamily . modified_huber || dist . distribution == DistributionFamily . bernoulli || dist . distribution == DistributionFamily . quasibinomial ) { fs [ 2 ] = p ; fs [ 1 ] = 1.0 - p ; return 1 ; } else if ( dist . distribution == DistributionFamily . multinomial ) { if ( nClasses == 2 ) { fs [ 1 ] = p ; fs [ 2 ] = 1 / p ; return fs [ 1 ] + fs [ 2 ] ; } assert ( offset == 0 ) ; fs [ 1 ] = f ; for ( int k = 1 ; k < nClasses ; k ++ ) fs [ k + 1 ] = chks [ treeIdx + k ] . atd ( row ) ; return hex . genmodel . GenModel . log_rescale ( fs ) ; } else { return fs [ 0 ] = p ; } }
turns the results into a probability distribution.