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