Skip to content

Commit 497862c

Browse files
committed
Added Done() call in BaseTestBaseline.Cleanup and added related fixes
1 parent 9d2b198 commit 497862c

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

src/Microsoft.ML.Data/Prediction/Calibrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ public sealed class NoArgumentsInput : CalibrateInputBase
20862086
public sealed class FixedPlattInput : CalibrateInputBase
20872087
{
20882088
[Argument(ArgumentType.AtMostOnce, ShortName = "slope", HelpText = "The slope parameter of the calibration function 1 / (1 + exp(-slope * x + offset)", SortOrder = 1)]
2089-
public Double Slope = 1;
2089+
public Double Slope = -1;
20902090

20912091
[Argument(ArgumentType.AtMostOnce, ShortName = "offset", HelpText = "The offset parameter of the calibration function 1 / (1 + exp(-slope * x + offset)", SortOrder = 3)]
20922092
public Double Offset = 0;

test/BaselineOutput/Common/EntryPoints/core_manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@
17381738
"Required": false,
17391739
"SortOrder": 1.0,
17401740
"IsNullable": false,
1741-
"Default": 1.0
1741+
"Default": -1.0
17421742
},
17431743
{
17441744
"Name": "Data",

test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,7 @@ public void EntryPointCalibrate()
15361536
var twiceCalibratedFfModel = Calibrate.Platt(Env,
15371537
new Calibrate.NoArgumentsInput() { Data = splitOutput.TestData[0], UncalibratedPredictorModel = calibratedFfModel }).PredictorModel;
15381538
var scoredFf = ScoreModel.Score(Env, new ScoreModel.Input() { Data = splitOutput.TestData[2], PredictorModel = twiceCalibratedFfModel }).ScoredData;
1539+
Done();
15391540
}
15401541

15411542
[Fact]

test/Microsoft.ML.Predictor.Tests/TestPredictors.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ public void TestEnsembleCombiner()
798798
};
799799

800800
CombineAndTestEnsembles(dataView, "pe", "oc=average", PredictionKind.BinaryClassification, predictors);
801+
Done();
801802
}
802803

803804
[X64Fact("x86 fails. Associated GitHubIssue: https://github.com/dotnet/machinelearning/issues/1216")]
@@ -948,7 +949,7 @@ private void CombineAndTestEnsembles(IDataView idv, string name, string options,
948949
predGetters[i](ref preds[i]);
949950
}
950951
if (scores.All(s => !float.IsNaN(s)))
951-
CompareNumbersWithTolerance(score, scores.Sum() / predCount);
952+
CompareNumbersWithTolerance(score, scores.Sum() / predCount, digitsOfPrecision: 5);
952953
for (int i = 0; i < predCount; i++)
953954
Assert.Equal(vectorScore.Length, vectorScores[i].Length);
954955
for (int i = 0; i < vectorScore.Length; i++)

test/Microsoft.ML.TestFramework/BaseTestBaseline.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ protected override void Cleanup()
126126
_normal ? "completed normally" : "aborted",
127127
IsPassing ? "passed" : "failed");
128128

129+
if (!_normal)
130+
Done();
131+
129132
Contracts.AssertValue(LogWriter);
130133
LogWriter.Dispose();
131134
LogWriter = null;

0 commit comments

Comments
 (0)