Skip to content

Commit ceac01f

Browse files
authored
Fix TrainAndPredictIrisModelUsingDirectInstantiationTest (#527)
The test `TrainAndPredictIrisModelUsingDirectInstantiationTest` now has analogous changes to the `TrainAndPredictIrisModelTest` test
1 parent 54596ac commit ceac01f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/IrisPlantClassificationTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ public void TrainAndPredictIrisModelUsingDirectInstantiationTest()
8989

9090
// Get feature importance i.e. weight vector
9191
var summary = ((MulticlassLogisticRegressionPredictor)pred).GetSummaryInKeyValuePairs(trainRoles.Schema);
92-
Assert.Equal(7.757867, Convert.ToDouble(summary[0].Value), 5);
92+
Assert.Equal(7.757864, Convert.ToDouble(summary[0].Value), 5);
9393
}
9494
}
9595

9696
private void ComparePredictions(PredictionEngine<IrisData, IrisPrediction> model)
9797
{
9898
IrisPrediction prediction = model.Predict(new IrisData()
9999
{
100-
SepalLength = 3.3f,
101-
SepalWidth = 1.6f,
102-
PetalLength = 0.2f,
103-
PetalWidth = 5.1f,
100+
SepalLength = 5.1f,
101+
SepalWidth = 3.3f,
102+
PetalLength = 1.6f,
103+
PetalWidth = 0.2f,
104104
});
105105

106106
Assert.Equal(1, prediction.PredictedLabels[0], 2);
@@ -109,10 +109,10 @@ private void ComparePredictions(PredictionEngine<IrisData, IrisPrediction> model
109109

110110
prediction = model.Predict(new IrisData()
111111
{
112-
SepalLength = 3.1f,
113-
SepalWidth = 5.5f,
114-
PetalLength = 2.2f,
115-
PetalWidth = 6.4f,
112+
SepalLength = 6.4f,
113+
SepalWidth = 3.1f,
114+
PetalLength = 5.5f,
115+
PetalWidth = 2.2f,
116116
});
117117

118118
Assert.Equal(0, prediction.PredictedLabels[0], 2);
@@ -121,10 +121,10 @@ private void ComparePredictions(PredictionEngine<IrisData, IrisPrediction> model
121121

122122
prediction = model.Predict(new IrisData()
123123
{
124-
SepalLength = 3.1f,
125-
SepalWidth = 2.5f,
126-
PetalLength = 1.2f,
127-
PetalWidth = 4.4f,
124+
SepalLength = 4.4f,
125+
SepalWidth = 3.1f,
126+
PetalLength = 2.5f,
127+
PetalWidth = 1.2f,
128128
});
129129

130130
Assert.Equal(.2, prediction.PredictedLabels[0], 1);

0 commit comments

Comments
 (0)