142 references to TestCommon
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
49
return Path.Combine(
TestCommon
.GetRepoRoot(), "test", "data", fileName);
Microsoft.ML.Core.Tests (3)
UnitTests\CoreBaseTestClass.cs (3)
79
return
TestCommon
.CompareVec<T>(in v1, in v2, size, fn);
260
if (!
TestCommon
.EqualTypes(type1, type2, exactTypes))
349
if (!
TestCommon
.EqualTypes(type1, type2, exactTypes))
Microsoft.ML.IntegrationTests (92)
DataIO.cs (2)
121
var filePath =
TestCommon
.GetOutputPath(OutDir, Path.GetRandomFileName());
130
var filePath =
TestCommon
.GetOutputPath(OutDir, Path.GetRandomFileName());
DataTransformation.cs (5)
33
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
86
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
132
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
170
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
197
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
Debugging.cs (3)
104
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
133
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
171
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
Evaluation.cs (10)
32
.Load(
TestCommon
.GetDataPath(DataDir, TestDatasets.mnistOneClass.trainFilename));
35
.Load(
TestCommon
.GetDataPath(DataDir, TestDatasets.mnistOneClass.testFilename));
60
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
89
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
118
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
146
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
171
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
232
TestCommon
.GetDataPath(DataDir, TestDatasets.trivialMatrixFactorization.trainFilename),
268
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
295
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
Explainability.cs (9)
35
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
52
var modelAndSchemaPath =
TestCommon
.GetOutputPath(OutDir, "TestFunctionalTestPFI.zip");
93
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
117
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
144
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
171
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
208
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
245
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
283
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
IntegrationTestBaseClass.cs (1)
21
RootDir =
TestCommon
.GetRepoRoot();
IntrospectiveTraining.cs (9)
35
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
75
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
138
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
178
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
219
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
259
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
289
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
332
var data = mlContext.Data.LoadFromTextFile<Adult>(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename),
389
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
ModelFiles.cs (29)
45
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
56
var modelPath =
TestCommon
.DeleteOutputPath(OutDir, "determineNugetVersionFromModel.zip");
92
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
102
var modelPath =
TestCommon
.DeleteOutputPath(OutDir, "fitPipelineSaveModelAndPredict.zip");
111
TestCommon
.CheckSameSchemas(data.Schema, serializedSchema);
134
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
150
string modelAndSchemaPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model-schema.zip");
155
string compositeLoaderModelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-composite-model.zip");
159
string loaderAndTransformerModelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-loader-transformer.zip");
178
TestCommon
.CheckSameSchemas(loadedCompositeLoader.GetOutputSchema(), s);
188
TestCommon
.CheckSameSchemas(loader.GetOutputSchema(), s);
241
trainedModel = mlContext.Model.Load(
TestCommon
.GetDataPath(DataDir, "backcompat", "modelwithoptionalcolumntransform.zip"), out dataViewSchema);
267
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
278
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
292
TestCommon
.CheckSameSchemas(loadedLoader.GetOutputSchema(), loadedSchema);
324
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
335
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
357
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
360
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
386
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
391
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
408
TestCommon
.CheckSameSchemas(loaderWithEmbeddedModel.GetOutputSchema(), loadedSchema);
410
TestCommon
.CheckSameSchemas(loaderWithEmbeddedModel.GetOutputSchema(), schemaFromLoadedLoader);
424
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
437
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
447
TestCommon
.CheckSameSchemas(expectedInputSchema, loadedInputSchema);
449
TestCommon
.CheckSameSchemas(expectedInputSchema, reloadedLoaderInputSchema);
457
var file = new MultiFileSource(
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename));
462
string modelPath =
TestCommon
.GetOutputPath(OutDir, FullTestName + "-model.zip");
ONNX.cs (6)
37
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
51
var modelPath =
TestCommon
.DeleteOutputPath(OutDir, modelFileName);
87
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
101
var modelPath =
TestCommon
.DeleteOutputPath(OutDir, modelFileName);
139
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
153
var modelPath =
TestCommon
.DeleteOutputPath(OutDir, modelFileName);
Prediction.cs (1)
46
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
SchemaDefinitionTests.cs (2)
33
var fileName =
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename);
63
var fileName =
TestCommon
.GetDataPath(DataDir, TestDatasets.adult.trainFilename);
Training.cs (11)
32
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
86
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
130
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
174
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
218
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
261
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
312
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename),
356
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename),
400
var data = mlContext.Data.LoadFromTextFile<TweetSentiment>(
TestCommon
.GetDataPath(DataDir, TestDatasets.Sentiment.trainFilename),
448
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
479
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename),
Validation.cs (4)
38
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
85
var trainDataView = reader.Load(
TestCommon
.GetDataPath(DataDir, "MSLRWeb1K-tiny.tsv"));
104
var data = mlContext.Data.LoadFromTextFile<HousingRegression>(
TestCommon
.GetDataPath(DataDir, TestDatasets.housing.trainFilename), hasHeader: true);
153
var data = mlContext.Data.LoadFromTextFile<Iris>(
TestCommon
.GetDataPath(DataDir, TestDatasets.iris.trainFilename), hasHeader: true);
Microsoft.ML.PerformanceTests (1)
BenchmarkBase.cs (1)
18
RootDir =
TestCommon
.GetRepoRoot();
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1193
Assert.True(
TestCommon
.CheckSameSchemas(outputSchema, testOutputSchema));
Microsoft.ML.TestFramework (22)
BaseTestClass.cs (5)
40
RootDir =
TestCommon
.GetRepoRoot();
116
return
TestCommon
.GetOutputPath(OutDir, name);
120
return
TestCommon
.GetOutputPath(OutDir, subDir, name);
124
return
TestCommon
.DeleteOutputPath(OutDir, subDir, name);
128
return
TestCommon
.DeleteOutputPath(OutDir, name);
DataPipe\TestDataPipe.cs (5)
237
Check(
TestCommon
.CompareVec(in v1, in v2, v1.Length, fn), "Mismatch");
593
if (!
TestCommon
.CompareVec(in bag1, in bag2, bag1.Length, (x1, x2) => x1 <= x2))
635
if (!
TestCommon
.CompareVec(in bag1, in bag2, bag1.Length, (x1, x2) => 2 * x1 == x2))
787
if (!
TestCommon
.CompareVec(in b1, in b2, b1.Length, (x1, x2) => 2 * x1 == x2))
930
TestCommon
.CompareVec(in buffer, in expected[index++], buffer.GetValues().Length, (s1, s2) => s1.Span.SequenceEqual(s2.Span));
DataPipe\TestDataPipeBase.cs (12)
101
TestCommon
.CheckSameSchemas(schema, mapper.OutputSchema);
109
TestCommon
.CheckSameSchemas(schema, loadedTransformer.GetOutputSchema(data.Schema));
111
TestCommon
.CheckSameSchemas(data.Schema, loadedInputSchema);
117
TestCommon
.CheckSameSchemas(schema, scoredTrain.Schema);
123
TestCommon
.CheckSameSchemas(scoredTrain.Schema, scoredTrain2.Schema);
205
if (!
TestCommon
.CheckSameSchemas(pipe1.Schema, reappliedPipe.Schema))
238
if (!
TestCommon
.CheckSameSchemas(pipe1.Schema, pipe2.Schema))
428
if (!
TestCommon
.CheckSameSchemas(view.Schema, loadedData.Schema, exactTypes: false, keyNames: false))
561
if (!
TestCommon
.CheckSameSchemas(view.Schema, loader.Schema))
612
if (!
TestCommon
.CheckSameSchemas(view.Schema, loader.Schema))
1028
return
TestCommon
.CompareVec<T>(in v1, in v2, size, fn);
1050
Assert.True(
TestCommon
.CompareVec(in fv, in fvn, size, compare));
Microsoft.ML.Tests (22)
SvmLightTests.cs (1)
170
TestCommon
.CheckSameSchemas(data.Schema, expectedData.Schema);
Transformers\CopyColumnEstimatorTests.cs (1)
156
Assert.True(
TestCommon
.CompareVec(in names1, in names2, size, (a, b) => a.Span.SequenceEqual(b.Span)));
Transformers\KeyToValueTests.cs (1)
88
TestCommon
.CheckSameSchemas(dataLeft.Schema, dataRight.Schema);
Transformers\NormalizerTests.cs (19)
493
TestCommon
.CheckSameSchemas(data1.Schema, data2.Schema);
494
TestCommon
.CheckSameSchemas(data1.Schema, data3.Schema);
495
TestCommon
.CheckSameSchemas(data1.Schema, data4.Schema);
496
TestCommon
.CheckSameSchemas(data1.Schema, data5.Schema);
510
TestCommon
.CheckSameSchemas(data6.Schema, data7.Schema);
511
TestCommon
.CheckSameSchemas(data6.Schema, data8.Schema);
523
TestCommon
.CheckSameSchemas(data9.Schema, data10.Schema);
524
TestCommon
.CheckSameSchemas(data9.Schema, data11.Schema);
536
TestCommon
.CheckSameSchemas(data12.Schema, data13.Schema);
537
TestCommon
.CheckSameSchemas(data12.Schema, data14.Schema);
549
TestCommon
.CheckSameSchemas(data15.Schema, data16.Schema);
550
TestCommon
.CheckSameSchemas(data15.Schema, data17.Schema);
562
TestCommon
.CheckSameSchemas(data18.Schema, data19.Schema);
563
TestCommon
.CheckSameSchemas(data18.Schema, data20.Schema);
612
TestCommon
.CheckSameSchemas(data1.Schema, data6.Schema);
613
TestCommon
.CheckSameSchemas(data2.Schema, data7.Schema);
614
TestCommon
.CheckSameSchemas(data3.Schema, data8.Schema);
615
TestCommon
.CheckSameSchemas(data4.Schema, data9.Schema);
616
TestCommon
.CheckSameSchemas(data5.Schema, data10.Schema);