Skip to content

Commit 761c86d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into FixNuGetPackages
2 parents 5ca8f81 + e9cd4bc commit 761c86d

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

DotnetCLIVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.2
1+
2.1.200

test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public void TrainAndPredictSentimentModelTest()
3232
OutputTokens = true,
3333
StopWordsRemover = new PredefinedStopWordsRemover(),
3434
VectorNormalizer = TextTransformTextNormKind.L2,
35-
CharFeatureExtractor = new NGramNgramExtractor() { NgramLength = 2, AllLengths = true },
36-
WordFeatureExtractor = new NGramNgramExtractor() { NgramLength = 3, AllLengths = false }
35+
CharFeatureExtractor = new NGramNgramExtractor() { NgramLength = 3, AllLengths = false },
36+
WordFeatureExtractor = new NGramNgramExtractor() { NgramLength = 2, AllLengths = true }
3737
});
3838

3939
pipeline.Add(new FastTreeBinaryClassifier() { NumLeaves = 5, NumTrees = 5, MinDocumentsInLeafs = 2 });
@@ -65,16 +65,16 @@ public void TrainAndPredictSentimentModelTest()
6565
var evaluator = new BinaryClassificationEvaluator();
6666
BinaryClassificationMetrics metrics = evaluator.Evaluate(model, testData);
6767

68-
Assert.Equal(.7222, metrics.Accuracy, 4);
69-
Assert.Equal(.9643, metrics.Auc, 1);
70-
Assert.Equal(.96, metrics.Auprc, 2);
68+
Assert.Equal(.5556, metrics.Accuracy, 4);
69+
Assert.Equal(.8, metrics.Auc, 1);
70+
Assert.Equal(.87, metrics.Auprc, 2);
7171
Assert.Equal(1, metrics.Entropy, 3);
72-
Assert.Equal(.7826, metrics.F1Score, 4);
73-
Assert.Equal(.812, metrics.LogLoss, 3);
74-
Assert.Equal(18.831, metrics.LogLossReduction, 3);
72+
Assert.Equal(.6923, metrics.F1Score, 4);
73+
Assert.Equal(.969, metrics.LogLoss, 3);
74+
Assert.Equal(3.083, metrics.LogLossReduction, 3);
7575
Assert.Equal(1, metrics.NegativePrecision, 3);
76-
Assert.Equal(.444, metrics.NegativeRecall, 3);
77-
Assert.Equal(.643, metrics.PositivePrecision, 3);
76+
Assert.Equal(.111, metrics.NegativeRecall, 3);
77+
Assert.Equal(.529, metrics.PositivePrecision, 3);
7878
Assert.Equal(1, metrics.PositiveRecall);
7979

8080
ConfusionMatrix matrix = metrics.ConfusionMatrix;
@@ -88,10 +88,10 @@ public void TrainAndPredictSentimentModelTest()
8888
Assert.Equal(0, matrix[0, 1]);
8989
Assert.Equal(0, matrix["positive", "negative"]);
9090

91-
Assert.Equal(5, matrix[1, 0]);
92-
Assert.Equal(5, matrix["negative", "positive"]);
93-
Assert.Equal(4, matrix[1, 1]);
94-
Assert.Equal(4, matrix["negative", "negative"]);
91+
Assert.Equal(8, matrix[1, 0]);
92+
Assert.Equal(8, matrix["negative", "positive"]);
93+
Assert.Equal(1, matrix[1, 1]);
94+
Assert.Equal(1, matrix["negative", "negative"]);
9595
}
9696

9797
public class SentimentData

0 commit comments

Comments
 (0)