Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class Options

public Options()
{
NgramLength = 1;
NgramLength = 2;
SkipLength = NgramExtractingEstimator.Defaults.SkipLength;
UseAllLengths = NgramExtractingEstimator.Defaults.UseAllLengths;
MaximumNgramsCount = new int[] { NgramExtractingEstimator.Defaults.MaximumNgramsCount };
Expand Down
1 change: 1 addition & 0 deletions test/BaselineOutput/Common/EntryPoints/core_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23696,6 +23696,7 @@
"Default": {
"Name": "NGram",
"Settings": {
"NgramLength": 2,
"MaxNumTerms": [
10000000
]
Expand Down
14 changes: 7 additions & 7 deletions test/BaselineOutput/Common/Text/featurized.tsv

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/Microsoft.ML.Tests/TrainerEstimators/LbfgsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public void TestLRWithStats()

Assert.NotNull(biasStats);

CompareNumbersWithTolerance(biasStats.StandardError, 0.25, digitsOfPrecision: 2);
CompareNumbersWithTolerance(biasStats.ZScore, 7.97, digitsOfPrecision: 2);
CompareNumbersWithTolerance(biasStats.StandardError, 0.24, digitsOfPrecision: 2);
CompareNumbersWithTolerance(biasStats.ZScore, 8.32, digitsOfPrecision: 2);

var scoredData = transformer.Transform(dataView);

var coefficients = stats.GetWeightsCoefficientStatistics(100);

Assert.Equal(18, coefficients.Length);
Assert.Equal(17, coefficients.Length);

foreach (var coefficient in coefficients)
Assert.True(coefficient.StandardError < 1.0);
Expand Down
6 changes: 3 additions & 3 deletions test/Microsoft.ML.Tests/Transformers/TextFeaturizerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ public void TextFeaturizerWithL2NormTest()
var prediction = engine.Predict(data[0]);
Assert.Equal(data[0].A, string.Join(" ", prediction.OutputTokens));
var exp1 = 0.333333343f;
var exp2 = 0.707106769f;
var expected = new float[] { exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp2, exp2 };
var exp2 = 0.577350259f;
var expected = new float[] { exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp1, exp2, exp2, exp2 };
Assert.Equal(expected, prediction.Features);

prediction = engine.Predict(data[1]);
exp1 = 0.4472136f;
Assert.Equal(data[1].A, string.Join(" ", prediction.OutputTokens));
expected = new float[] { exp1, 0.0f, 0.0f, 0.0f, 0.0f, exp1, exp1, exp1, exp1, 0.0f, 1.0f };
expected = new float[] { exp1, 0.0f, 0.0f, 0.0f, 0.0f, exp1, exp1, exp1, exp1, 0.0f, 0.0f, 1.0f };
Assert.Equal(expected, prediction.Features);
}

Expand Down