Skip to content

Commit 3a67603

Browse files
authored
[AutoML] Fix for Exception thrown in cross val when one of the score equals infinity. (#4073)
* bumped version * change versions in nupkg * revert version bump in branch props * added infinity fix
1 parent 4f3d82d commit 3a67603

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.ML.AutoML/Experiment/Runners/CrossValSummaryRunner.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private static int GetIndexClosestToAverage(IEnumerable<double> values, double a
8989
for (var i = 0; i < values.Count(); i++)
9090
{
9191
var distFromAvg = Math.Abs(values.ElementAt(i) - average);
92-
if (distFromAvg < smallestDistFromAvg)
92+
if (distFromAvg < smallestDistFromAvg || smallestDistFromAvg == double.PositiveInfinity)
9393
{
9494
smallestDistFromAvg = distFromAvg;
9595
avgFoldIndex = i;

0 commit comments

Comments
 (0)