Skip to content

Commit 55069b8

Browse files
srsaggamDmitry-A
authored andcommitted
[AutoML] Fix for Exception thrown in cross val when one of the score equals infinity. (dotnet#4073)
* bumped version * change versions in nupkg * revert version bump in branch props * added infinity fix
1 parent 11848e6 commit 55069b8

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
@@ -90,7 +90,7 @@ private static int GetIndexClosestToAverage(IEnumerable<double> values, double a
9090
for (var i = 0; i < values.Count(); i++)
9191
{
9292
var distFromAvg = Math.Abs(values.ElementAt(i) - average);
93-
if (distFromAvg < smallestDistFromAvg)
93+
if (distFromAvg < smallestDistFromAvg || smallestDistFromAvg == double.PositiveInfinity)
9494
{
9595
smallestDistFromAvg = distFromAvg;
9696
avgFoldIndex = i;

0 commit comments

Comments
 (0)