Fix theoretical bug

This commit is contained in:
Joel Therrien 2019-01-28 11:45:06 -08:00
parent d8e52ecd82
commit 77ec780304

View file

@ -70,7 +70,7 @@ public abstract class CompetingRiskGroupDifferentiator<Y extends CompetingRiskRe
final Double score = getScore(competingRiskSets); final Double score = getScore(competingRiskSets);
if(Double.isFinite(score) && (bestScore == null || score > bestScore)){ if(score != null && !Double.isNaN(score) && Double.isFinite(score) && (bestScore == null || score > bestScore)){
bestScore = score; bestScore = score;
bestSplit = candidateSplit; bestSplit = candidateSplit;
} }
@ -102,7 +102,7 @@ public abstract class CompetingRiskGroupDifferentiator<Y extends CompetingRiskRe
final Double score = getScore(competingRiskSets); final Double score = getScore(competingRiskSets);
if(Double.isFinite(score) && (bestScore == null || score > bestScore)){ if(score != null && !Double.isNaN(score) && Double.isFinite(score) && (bestScore == null || score > bestScore)){
bestScore = score; bestScore = score;
bestSplit = splitRuleUpdater.currentSplit(); bestSplit = splitRuleUpdater.currentSplit();
} }