214 references to Equal
Microsoft.DotNet.XUnitAssert.Tests (8)
EqualityAssertsTests.cs (8)
2061 var ex = Record.Exception(() => Assert.Equal(0.0, 1.0, double.NegativeInfinity)); 2071 Assert.Equal(10.566, 10.565, 0.01); 2081 var ex = Record.Exception(() => Assert.Equal(0.11113, 0.11115, 0.00001)); 2095 Assert.Equal(double.NaN, double.NaN, 1000.0); 2105 var ex = Record.Exception(() => Assert.Equal(20210102.2208, double.NaN, 20000000.0)); 2119 Assert.Equal(double.MinValue, double.MaxValue, double.PositiveInfinity); 2129 var ex = Record.Exception(() => Assert.Equal(double.PositiveInfinity, 77.7, 1.0)); 2147 var ex = Record.Exception(() => Assert.Equal(0.0, double.NegativeInfinity, 1.0));
Microsoft.ML.Core.Tests (15)
UnitTests\TestEntryPoints.cs (11)
97Assert.Equal(0.9, (double)trainRows / totalRows, 0.1); 5008Assert.Equal(0.93, auc, 0.01); 5211Assert.Equal(1.585, stdev, .001); 5213Assert.Equal(1.39, stdev, 0.01); 5382Assert.Equal(0.024809923969586353, stdev, 0.001); 5791Assert.Equal(0.02582, stdev, 0.00001); 6092Assert.Equal(0.02462, stdevValues[0], 0.00001); 6093Assert.Equal(0.02763, stdevValues[1], 0.00001); 6094Assert.Equal(0.03273, stdevValues[2], 0.00001); 6294Assert.Equal(0.96, acc, 0.01); 6466Assert.Equal(0.71, acc, 0.01);
UnitTests\TestLoss.cs (3)
42Assert.Equal(expectedLoss, loss, 0.00001); 43Assert.Equal(expectedUpdate, -derivative, 0.00001); 51Assert.Equal((almostLoss - loss) / (almostOutput - output), derivative, 0.1);
UnitTests\TestVBuffer.cs (1)
296Assert.Equal(expectedValues[i], actualValues[i], 0.000001);
Microsoft.ML.CpuMath.UnitTests (9)
UnitTests.cs (9)
644Assert.Equal((double)expected, (double)actual, 0.01); 667Assert.Equal((double)expected, (double)actual, 0.01); 692Assert.Equal((double)expected, (double)actual, 0.1); 715Assert.Equal((double)expected, (double)actual, 0.01); 740Assert.Equal((double)expected, (double)actual, 0.01); 768Assert.Equal((double)expected, (double)actual, 0.01); 796Assert.Equal((double)expected, (double)actual, 0.01); 826Assert.Equal((double)expected, (double)actual, 0.1); 860Assert.Equal((double)expected, (double)actual, 0.01);
Microsoft.ML.Fairlearn.Tests (15)
MetricTest.cs (11)
41Assert.Equal(-2.30578, Convert.ToSingle(metricByGroup["RSquared"][0]), 0.001); 42Assert.Equal(-2039.81453, Convert.ToSingle(metricByGroup["RSquared"][1]), 0.001); 43Assert.Equal(1.00000, Convert.ToSingle(metricByGroup["RMS"][0]), 0.001); 44Assert.Equal(15.811388, Convert.ToSingle(metricByGroup["RMS"][1]), 0.001); 47Assert.Equal(125.5, metricOverall["MSE"], 0.1); 48Assert.Equal(11.202678, metricOverall["RMS"], 0.0001); 50Assert.Equal(14.81138, diff["RMS"], 0.0001); 51Assert.Equal(2037.5, diff["RSquared"], 0.1); 73Assert.Equal(0.8, Convert.ToSingle(metricByGroup["Accuracy"][0]), 0.1); 74Assert.Equal(0.6, Convert.ToSingle(metricByGroup["Accuracy"][1]), 0.1); 76Assert.Equal(0.7, Convert.ToSingle(metricOverall["Accuracy"]), 0.1);
UtilityTest.cs (4)
34Assert.Equal(0.1, Convert.ToSingle(gSinged["value"][0]), 0.1); 35Assert.Equal(-0.1, Convert.ToSingle(gSinged["value"][1]), 0.1); 36Assert.Equal(-0.1, Convert.ToSingle(gSinged["value"][2]), 0.1); 37Assert.Equal(0.1, Convert.ToSingle(gSinged["value"][3]), 0.1);
Microsoft.ML.IntegrationTests (5)
IntrospectiveTraining.cs (2)
122Assert.Equal(expectedSplitGains[i], finalTree.SplitGains[i], 0.000001); 123Assert.Equal((double)expectedThresholds[i], (double)finalTree.NumericalSplitThresholds[i], 0.000001);
ONNX.cs (2)
74Assert.Equal(originalPrediction.Score, onnxPrediction.Score[0], 0.0001); 173Assert.Equal(originalPrediction.Score, onnxPrediction.Score[0], 0.0001);
Training.cs (1)
501Assert.Equal(0.4367, binaryClassificationMetrics.LogLoss, 0.0001);
Microsoft.ML.OnnxTransformerTest (3)
OnnxTransformTests.cs (3)
567Assert.Equal(-0.080, predictions[0].variable[0], 0.001); 568Assert.Equal(1.204, predictions[1].variable[0], 0.001); 569Assert.Equal(2.27, predictions[2].variable[0], 0.001);
Microsoft.ML.Predictor.Tests (3)
TestGamPublicInterfaces.cs (1)
46Assert.Equal(intercept, gam.Bias, 0.000001);
TestPredictors.cs (2)
740Assert.Equal(score, 0.4 * scores.Sum() / predCount, 0.00001); 741Assert.Equal(prob, 1 / (1 + Math.Exp(-score)), 0.000001);
Microsoft.ML.TensorFlow.Tests (13)
TensorflowTests.cs (13)
162Assert.Equal(1, metrics.MicroAccuracy, 0.01); 169Assert.Equal(0d, prediction.PredictedScores[0], 0.01); 170Assert.Equal(1d, prediction.PredictedScores[1], 0.01); 171Assert.Equal(0d, prediction.PredictedScores[2], 0.01); 177Assert.Equal(0d, prediction.PredictedScores[0], 0.01); 178Assert.Equal(0d, prediction.PredictedScores[1], 0.01); 179Assert.Equal(1d, prediction.PredictedScores[2], 0.01); 677Assert.Equal(0.99, metrics.MicroAccuracy, .01); 678Assert.Equal(0.93, metrics.MacroAccuracy, 0.01); 902Assert.Equal(0.99, metrics.MicroAccuracy, .01); 903Assert.Equal(.93, metrics.MacroAccuracy, 0.01); 1173Assert.Equal(1, metrics.MicroAccuracy, 0.01); 1208Assert.Equal((double)predictions[i].PredictedScores[j], (double)testPredictions[i].PredictedScores[j], 0.01);
Microsoft.ML.Tests (112)
AnomalyDetectionTests.cs (2)
36Assert.Equal(0.98667, metrics.AreaUnderRocCurve, 0.00001); 37Assert.Equal(0.90000, metrics.DetectionRateAtFalsePositiveCount, 0.00001);
EvaluateTests.cs (1)
68Assert.Equal(expectedTopKArray2[i], output2[i], 0.0000001);
LearningRateSchedulerTest.cs (1)
51Assert.Equal((double)expectedValues[i], (double)decayedLR, 0.0001);
Scenarios\ClusteringTests.cs (1)
90Assert.Equal(0d, metrics.AverageDistance, 0.00001);
Scenarios\IrisPlantClassificationTests.cs (14)
58Assert.Equal(1d, prediction.PredictedLabels[0], 0.01); 59Assert.Equal(0d, prediction.PredictedLabels[1], 0.01); 60Assert.Equal(0d, prediction.PredictedLabels[2], 0.01); 70Assert.Equal(0d, prediction.PredictedLabels[0], 0.01); 71Assert.Equal(0d, prediction.PredictedLabels[1], 0.01); 72Assert.Equal(1d, prediction.PredictedLabels[2], 0.01); 82Assert.Equal(.2, prediction.PredictedLabels[0], 0.1); 83Assert.Equal(.8, prediction.PredictedLabels[1], 0.1); 84Assert.Equal(0d, prediction.PredictedLabels[2], 0.01); 91Assert.Equal(.98, metrics.MicroAccuracy, 0.01); 92Assert.Equal(.06, metrics.LogLoss, 0.01); 96Assert.Equal(0d, metrics.PerClassLogLoss[0], 0.1); 97Assert.Equal(.1, metrics.PerClassLogLoss[1], 0.1); 98Assert.Equal(.1, metrics.PerClassLogLoss[2], 0.1);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (14)
57Assert.Equal(1d, prediction.PredictedScores[0], 0.01); 58Assert.Equal(0d, prediction.PredictedScores[1], 0.01); 59Assert.Equal(0d, prediction.PredictedScores[2], 0.01); 70Assert.Equal(0d, prediction.PredictedScores[0], 0.01); 71Assert.Equal(0d, prediction.PredictedScores[1], 0.01); 72Assert.Equal(1d, prediction.PredictedScores[2], 0.01); 83Assert.Equal(.2, prediction.PredictedScores[0], 0.1); 84Assert.Equal(.8, prediction.PredictedScores[1], 0.1); 85Assert.Equal(0d, prediction.PredictedScores[2], 0.01); 93Assert.Equal(.98, metrics.MicroAccuracy, 0.01); 94Assert.Equal(.06, metrics.LogLoss, 0.01); 99Assert.Equal(0d, metrics.PerClassLogLoss[0], 0.1); 100Assert.Equal(.1, metrics.PerClassLogLoss[1], 0.1); 101Assert.Equal(.1, metrics.PerClassLogLoss[2], 0.1);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (13)
64Assert.Equal(1d, prediction.PredictedLabels[0], 0.01); 65Assert.Equal(0d, prediction.PredictedLabels[1], 0.01); 66Assert.Equal(0d, prediction.PredictedLabels[2], 0.01); 76Assert.Equal(0d, prediction.PredictedLabels[0], 0.01); 77Assert.Equal(0d, prediction.PredictedLabels[1], 0.01); 78Assert.Equal(1d, prediction.PredictedLabels[2], 0.01); 88Assert.Equal(.2, prediction.PredictedLabels[0], 0.1); 89Assert.Equal(.8, prediction.PredictedLabels[1], 0.1); 90Assert.Equal(0d, prediction.PredictedLabels[2], 0.01); 96Assert.Equal(.98, metrics.MicroAccuracy, 0.01); 101Assert.Equal(0d, metrics.PerClassLogLoss[0], 0.1); 102Assert.Equal(.1, metrics.PerClassLogLoss[1], 0.1); 103Assert.Equal(.1, metrics.PerClassLogLoss[2], 0.1);
TrainerEstimators\MatrixFactorizationTests.cs (14)
99Assert.Equal(0.3041052520275116, leftMatrix[0], 0.0001); 101Assert.Equal(0.309137582778931, leftMatrix[0], 0.0001); 102Assert.Equal(0.468956589698792, leftMatrix[leftMatrix.Count - 1], 0.0001); 103Assert.Equal(0.303486406803131, rightMatrix[0], 0.0001); 104Assert.Equal(0.503888845443726, rightMatrix[rightMatrix.Count - 1], 0.0001); 690Assert.Equal(0.987113833, firstElement.Score, 0.001); 691Assert.Equal(1d, firstElement.Value, 0.001); 695Assert.Equal(0.149993762, lastElement.Score, 0.001); 696Assert.Equal(0.15, lastElement.Value, 0.001); 708Assert.Equal(0.987113833, firstElement.Score, 0.001); 709Assert.Equal(1d, firstElement.Value, 0.001); 713Assert.Equal(0.987113833, lastElement.Score, 0.001); 714Assert.Equal(1d, lastElement.Value, 0.001); 845Assert.Equal((double)predictions[i].Score, (double)valuesAtSecondColumn[i], 0.001);
TrainerEstimators\SdcaTests.cs (8)
132Assert.Equal(0.9658, metrics1.AreaUnderRocCurve, 0.0001); 133Assert.Equal(0.3488, metrics1.LogLoss, 0.0001); 134Assert.Equal(0.9596, metrics2.AreaUnderRocCurve, 0.0001); 135Assert.Equal(0.3591, metrics2.LogLoss, 0.0001); 191Assert.Equal(0.9100, metrics1.TopKAccuracy, 0.0001); 192Assert.Equal(0.2411, metrics1.LogLoss, 0.0001); 193Assert.Equal(0.8800, metrics2.TopKAccuracy, 0.0001); 194Assert.Equal(0.2464, metrics2.LogLoss, 0.0001);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (4)
630Assert.Equal(metrics.MeanAbsoluteError, loadedMetrics.MeanAbsoluteError, 0.00001); 631Assert.Equal(metrics.MeanSquaredError, loadedMetrics.MeanSquaredError, 0.00001); 690Assert.Equal(metrics.MeanAbsoluteError, loadedMetrics.MeanAbsoluteError, 0.00001); 691Assert.Equal(metrics.MeanSquaredError, loadedMetrics.MeanSquaredError, 0.00001);
TrainerEstimators\TreeEstimators.cs (8)
564Assert.Equal(nativeResult0[j + i * _classNumber], mlnetPredictions[i].Score[j], 0.000001); 572Assert.Equal(prob / sum, mlnetPredictions[i].Score[j], 0.000001); 600Assert.Equal(nativeResult0[j + i * _classNumber], mlnetPredictions[i].Score[j], 0.000001); 608Assert.Equal(prob / sum, mlnetPredictions[i].Score[j], 0.000001); 671Assert.Equal(nativeResult0[j + i * _classNumber], mlnetPredictions[i].Score[j], 0.000001); 677Assert.Equal(prob / sum, mlnetPredictions[i].Score[j], 0.000001); 700Assert.Equal(nativeResult0[j + i * _classNumber], mlnetPredictions[i].Score[j], 0.000001); 706Assert.Equal(prob / sum, mlnetPredictions[i].Score[j], 0.000001);
Transformers\NormalizerTests.cs (32)
398Assert.Equal(1 / 1.8, floatAffineModel.Scale, 0.01); 399Assert.Equal(5.8d, floatAffineModel.Offset, 0.01); 403Assert.Equal(.5555556, floatAffineModelVec.Scale[0], 0.01); 404Assert.Equal(.8333333, floatAffineModelVec.Scale[1], 0.01); 405Assert.Equal(.3389830, floatAffineModelVec.Scale[2], 0.01); 406Assert.Equal(.8333333, floatAffineModelVec.Scale[3], 0.01); 408Assert.Equal(5.8, floatAffineModelVec.Offset[0], 0.01); 409Assert.Equal(3d, floatAffineModelVec.Offset[1], 0.01); 410Assert.Equal(4.4, floatAffineModelVec.Offset[2], 0.01); 411Assert.Equal(1.3, floatAffineModelVec.Offset[3], 0.01); 414Assert.Equal(1 / 1.8, doubleAffineModel.Scale, 0.01); 415Assert.Equal(5.8, doubleAffineModel.Offset, 0.01); 419Assert.Equal(.5555556, doubleAffineModelVector.Scale[0], 0.01); 420Assert.Equal(.8333333, doubleAffineModelVector.Scale[1], 0.01); 421Assert.Equal(.3389830, doubleAffineModelVector.Scale[2], 0.01); 422Assert.Equal(.8333333, doubleAffineModelVector.Scale[3], 0.01); 424Assert.Equal(5.8, doubleAffineModelVector.Offset[0], 0.01); 425Assert.Equal(3, doubleAffineModelVector.Offset[1], 0.01); 426Assert.Equal(4.4, doubleAffineModelVector.Offset[2], 0.01); 427Assert.Equal(1.3, doubleAffineModelVector.Offset[3], 0.01); 438Assert.Equal(1 / 1.8, floatAffineModel.Scale, 0.01); 439Assert.Equal(0d, floatAffineModel.Offset, 0.01); 443Assert.Equal(.5555556, floatAffineModelVec.Scale[0], 0.01); 444Assert.Equal(.8333333, floatAffineModelVec.Scale[1], 0.01); 445Assert.Equal(.3389830, floatAffineModelVec.Scale[2], 0.01); 446Assert.Equal(.8333333, floatAffineModelVec.Scale[3], 0.01); 451Assert.Equal(1 / 1.8, doubleAffineModel.Scale, 0.01); 452Assert.Equal(0, doubleAffineModel.Offset, 0.01); 456Assert.Equal(.5555556, doubleAffineModelVector.Scale[0], 0.01); 457Assert.Equal(.8333333, doubleAffineModelVector.Scale[1], 0.01); 458Assert.Equal(.3389830, doubleAffineModelVector.Scale[2], 0.01); 459Assert.Equal(.8333333, doubleAffineModelVector.Scale[3], 0.01);
Microsoft.ML.TimeSeries.Tests (31)
TimeSeriesDirectApi.cs (27)
198Assert.Equal(expectedValues[index++], row.Change[0], 0.0000001); // Alert 199Assert.Equal(expectedValues[index++], row.Change[1], 0.0000001); // Raw score 200Assert.Equal(expectedValues[index++], row.Change[2], 0.0000001); // P-Value score 201Assert.Equal(expectedValues[index++], row.Change[3], 0.0000001); // Martingale score 258Assert.Equal(1.1661833524703979, prediction2.Change[1], 0.00001); // Raw score 261Assert.Equal(0.12216401100158691, prediction2.Change[1], 0.00001); // Raw score 278Assert.Equal(0.12216401100158691, prediction2.Change[1], 0.00001); // Raw score 321Assert.Equal(0, prediction.Change[0], 0.0000001); // Alert 322Assert.Equal(1.1661833524703979, prediction.Change[1], 0.00001); // Raw score 323Assert.Equal(0.5, prediction.Change[2], 0.0000001); // P-Value score 324Assert.Equal(5.1200000000000114E-08, prediction.Change[3], 0.0000001); // Martingale score 332Assert.Equal(0, prediction.Change[0], 0.0000001); // Alert 333Assert.Equal(0.12216401100158691, prediction.Change[1], 0.00001); // Raw score 334Assert.Equal(0.14823824685192111, prediction.Change[2], 0.00001); // P-Value score 335Assert.Equal(1.5292508189989167E-07, prediction.Change[3], 0.0000001); // Martingale score 345Assert.Equal(0, prediction.Change[0], 0.0000001); // Alert 346Assert.Equal(0.12216401100158691, prediction.Change[1], 0.00001); // Raw score 347Assert.Equal(0.14823824685192111, prediction.Change[2], 0.00001); // P-Value score 348Assert.Equal(1.5292508189989167E-07, prediction.Change[3], 0.00001); // Martingale score 408Assert.Equal(expectedForecast[localIndex], row.Forecast[localIndex], 0.0000001); 409Assert.Equal(minCnf[localIndex], row.MinCnf[localIndex], 0.0000001); 410Assert.Equal(maxCnf[localIndex], row.MaxCnf[localIndex], 0.0000001); 648Assert.Equal(5.00, prediction.Prediction[3], 0.01); 658Assert.Equal(5.00, prediction.Prediction[3], 0.01); 659Assert.Equal(5.00, prediction.Prediction[4], 0.01); 660Assert.Equal(5.01, prediction.Prediction[5], 0.01); 661Assert.Equal(4.99, prediction.Prediction[6], 0.01);
TimeSeriesSimpleApiTests.cs (4)
69Assert.Equal(expectedValues[index++], row.Data[0], 0.0000001); 70Assert.Equal(expectedValues[index++], row.Data[1], 0.0000001); 71Assert.Equal(expectedValues[index++], row.Data[2], 0.0000001); 72Assert.Equal(expectedValues[index++], row.Data[3], 0.0000001);