From ff655708bafbf8d0e98dd52bb0803be4fbee7b39 Mon Sep 17 00:00:00 2001 From: Antonio Velazquez Date: Wed, 28 Oct 2020 17:08:09 -0700 Subject: [PATCH] Added multiple cultures --- .../Microsoft.ML.AutoML.Tests/AutoFitTests.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs b/test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs index b77700fa01..c4e169d387 100644 --- a/test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs +++ b/test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs @@ -105,14 +105,17 @@ private void Context_Log(object sender, LoggingEventArgs e) } [Theory] - [InlineData(false)] - [InlineData(true)] - public void AutoFitRegressionTest(bool foreignCulture) + [InlineData("en-US")] + [InlineData("ar-SA")] + [InlineData("pl-PL")] + public void AutoFitRegressionTest(string culture) { var originalCulture = Thread.CurrentThread.CurrentCulture; + Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); + uint experimentTime = 0; - if (foreignCulture) + if (culture == "ar-SA") { // If users run AutoML with a different local, sometimes // the sweeper encounters problems when parsing some strings. @@ -120,11 +123,14 @@ public void AutoFitRegressionTest(bool foreignCulture) // Furthermore, these issues might only occur after several // iterations, so more experiment time is needed for this to // occur. - Thread.CurrentThread.CurrentCulture = new CultureInfo("pl-PL"); experimentTime = 30; } - + else if(culture == "pl-PL") + { + experimentTime = 100; + } + var context = new MLContext(1); var dataPath = DatasetUtil.GetMlNetGeneratedRegressionDataset(); var columnInference = context.Auto().InferColumns(dataPath, DatasetUtil.MlNetGeneratedRegressionLabel); @@ -139,8 +145,7 @@ public void AutoFitRegressionTest(bool foreignCulture) Assert.True(result.RunDetails.Max(i => i.ValidationMetrics.RSquared > 0.9)); - if(foreignCulture) - Thread.CurrentThread.CurrentCulture = originalCulture; + Thread.CurrentThread.CurrentCulture = originalCulture; } [LightGBMFact]