Skip to content

Commit

Permalink
Debug runSpecific
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovs1029 committed Oct 29, 2020
1 parent 4f6b119 commit 95b7280
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .vsts-dotnet-ci.yml
Expand Up @@ -27,7 +27,7 @@ jobs:
_config_short: RI
_includeBenchmarkData: true
_targetFramework: netcoreapp3.1
innerLoop: true
runSpecific: true
pool:
name: Hosted Ubuntu 1604

Expand All @@ -36,15 +36,15 @@ jobs:
name: Ubuntu_x64_NetCoreApp21
buildScript: ./build.sh
container: UbuntuContainer
innerLoop: true
runSpecific: true
pool:
name: Hosted Ubuntu 1604

- template: /build/ci/job-template.yml
parameters:
name: MacOS_x64_NetCoreApp21
buildScript: ./build.sh
innerLoop: true
runSpecific: true
pool:
name: Hosted macOS

Expand All @@ -63,7 +63,7 @@ jobs:
_config_short: RI
_includeBenchmarkData: true
_targetFramework: netcoreapp3.1
innerLoop: true
runSpecific: true
vsTestConfiguration: "/Framework:.NETCoreApp,Version=v3.0"
pool:
name: Hosted VS2017
Expand All @@ -72,7 +72,7 @@ jobs:
parameters:
name: Windows_x64_NetCoreApp21
buildScript: build.cmd
innerLoop: true
runSpecific: true
vsTestConfiguration: "/Framework:.NETCoreApp,Version=v2.1"
pool:
name: Hosted VS2017
Expand All @@ -92,7 +92,7 @@ jobs:
_config_short: RFX
_includeBenchmarkData: false
_targetFramework: win-x64
innerLoop: true
runSpecific: true
vsTestConfiguration: "/Framework:.NETCoreApp,Version=v4.0"
pool:
name: Hosted VS2017
Expand All @@ -102,7 +102,7 @@ jobs:
name: Windows_x86_NetCoreApp21
architecture: x86
buildScript: build.cmd
innerLoop: true
runSpecific: true
vsTestConfiguration: "/Framework:.NETCoreApp,Version=v2.1"
pool:
name: Hosted VS2017
13 changes: 11 additions & 2 deletions test/Microsoft.ML.AutoML.Tests/AutoFitTests.cs
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Globalization;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -105,6 +106,7 @@ private void Context_Log(object sender, LoggingEventArgs e)
}

[Theory]
[Trait("Category", "RunSpecificTest")]
[InlineData("en-US")]
[InlineData("ar-SA")]
[InlineData("pl-PL")]
Expand All @@ -113,7 +115,7 @@ public void AutoFitRegressionTest(string culture)
var originalCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);

uint experimentTime = 0;
uint experimentTime = 30;

if (culture == "ar-SA")
{
Expand All @@ -132,6 +134,7 @@ public void AutoFitRegressionTest(string culture)
}

var context = new MLContext(1);
context.Log += (sender, e) => Console.WriteLine(e); //MYTODO: added for debugging purposes
var dataPath = DatasetUtil.GetMlNetGeneratedRegressionDataset();
var columnInference = context.Auto().InferColumns(dataPath, DatasetUtil.MlNetGeneratedRegressionLabel);
var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions);
Expand All @@ -143,8 +146,14 @@ public void AutoFitRegressionTest(string culture)
.Execute(trainData, validationData,
new ColumnInformation() { LabelColumnName = DatasetUtil.MlNetGeneratedRegressionLabel });

//var trainers = Enum.GetValues(typeof(RegressionTrainer)).OfType<RegressionTrainer>().ToList();

//MYTODO: Only adding this for debugging purposes on the CI:
System.Console.WriteLine($"culture:{culture} - Count: {result.RunDetails.Count()} - Null ValidationMetrics Count:{result.RunDetails.Where(rd => rd.ValidationMetrics == null).Count()}");
var nullValidationMetrics = result.RunDetails.Where(rd => rd.ValidationMetrics == null).ToArray();
System.Console.WriteLine($"culture:{culture} - Count: {result.RunDetails.Count()} - Null ValidationMetrics Count:{nullValidationMetrics.Count()}");
if (nullValidationMetrics.Count() > 0)
for (var i = 0; i < nullValidationMetrics.Count(); i++)
Console.WriteLine($"nullValidationMetrics[{i}].TrainerName={nullValidationMetrics[i].TrainerName}");

Assert.True(result.RunDetails.Max(i => i.ValidationMetrics.RSquared > 0.9));

Expand Down

0 comments on commit 95b7280

Please sign in to comment.