Github user srowen commented on a diff in the pull request:
    --- Diff: 
    @@ -200,22 +200,17 @@ abstract class ProbabilisticClassificationModel[
         if (!isDefined(thresholds)) {
         } else {
    -      val thresholds: Array[Double] = getThresholds
    -      val probabilities = probability.toArray
    +      val thresholds = getThresholds
           var argMax = 0
           var max = Double.NegativeInfinity
           var i = 0
           val probabilitySize = probability.size
           while (i < probabilitySize) {
    -        if (thresholds(i) == 0.0) {
    -          max = Double.PositiveInfinity
    +        // thresholds are all > 0, excepting that at most one may be 0
    +        val scaled = probability(i) / thresholds(i)
    +        if (scaled > max) {
    --- End diff --
    Yeah, that occurred to me. It will never be selected because NaN isn't 
bigger than anything, including NegativeInfinity. If for some reason you have 
one class only (is this even valid?) you'd select this class, which is I guess 
    Very small but positive prob / threshold? that should still work fine to 
the limits of machine precision here.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to