Skip to content

Commit

Permalink
Reverted fixed seed related changes from the code generator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harishsk committed Jan 29, 2020
1 parent 853b68b commit 4492586
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace TestNamespace.ConsoleApp
private static ModelInput CreateSingleDataSample(string dataFilePath)
{
// Create MLContext
MLContext mlContext = new MLContext(1);
MLContext mlContext = new MLContext();

// Load dataset
IDataView dataView = mlContext.Data.LoadFromTextFile<ModelInput>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace TestNamespace.Model
{

// Create new MLContext
MLContext mlContext = new MLContext(1);
MLContext mlContext = new MLContext();

// Load model & create prediction engine
string modelPath = AppDomain.CurrentDomain.BaseDirectory + "MLModel.zip";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace TestNamespace.ConsoleApp
private static ModelInput CreateSingleDataSample(string dataFilePath)
{
// Create MLContext
MLContext mlContext = new MLContext(1);
MLContext mlContext = new MLContext();

// Load dataset
IDataView dataView = mlContext.Data.LoadFromTextFile<ModelInput>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace TestNamespace.ConsoleApp
private static ModelInput CreateSingleDataSample(string dataFilePath)
{
// Create MLContext
MLContext mlContext = new MLContext(1);
MLContext mlContext = new MLContext();

// Load dataset
IDataView dataView = mlContext.Data.LoadFromTextFile<ModelInput>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace TestNamespace.Model
{

// Create new MLContext
MLContext mlContext = new MLContext(1);
MLContext mlContext = new MLContext();

// Load model & create prediction engine
string modelPath = AppDomain.CurrentDomain.BaseDirectory + "MLModel.zip";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private CodeGenerator PrepareForRecommendationTask()
{
if (mockedPipeline == null)
{
MLContext context = new MLContext(1);
MLContext context = new MLContext();

var trainer1 = new SuggestedTrainer(context, new MatrixFactorizationExtension(), new ColumnInformation() {
LabelColumnName = "Label",
Expand Down Expand Up @@ -335,7 +335,7 @@ private CodeGenerator PrepareForRecommendationTask()
{
if (mockedPipeline == null)
{
MLContext context = new MLContext(1);
MLContext context = new MLContext();
// same learners with different hyperparams
var hyperparams1 = new Microsoft.ML.AutoML.ParameterSet(new List<Microsoft.ML.AutoML.IParameterValue>() { new LongParameterValue("NumLeaves", 2) });
var trainer1 = new SuggestedTrainer(context, new LightGbmBinaryExtension(), new ColumnInformation(), hyperparams1);
Expand Down Expand Up @@ -372,7 +372,7 @@ private CodeGenerator PrepareForRecommendationTask()
{
if (mockedPipeline == null)
{
MLContext context = new MLContext(1);
MLContext context = new MLContext();
// same learners with different hyperparams
var hyperparams1 = new Microsoft.ML.AutoML.ParameterSet(new List<Microsoft.ML.AutoML.IParameterValue>() { new LongParameterValue("NumLeaves", 2) });
var trainer1 = new SuggestedTrainer(context, new LightGbmRegressionExtension(), new ColumnInformation(), hyperparams1);
Expand Down Expand Up @@ -409,7 +409,7 @@ private CodeGenerator PrepareForRecommendationTask()
{
if (mockedOvaPipeline == null)
{
MLContext context = new MLContext(1);
MLContext context = new MLContext();
// same learners with different hyperparams
var hyperparams1 = new Microsoft.ML.AutoML.ParameterSet(new List<Microsoft.ML.AutoML.IParameterValue>() { new LongParameterValue("NumLeaves", 2) });
var trainer1 = new SuggestedTrainer(context, new FastForestOvaExtension(), new ColumnInformation(), hyperparams1);
Expand Down
10 changes: 5 additions & 5 deletions test/Microsoft.ML.CodeGenerator.Tests/CodeGenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CodeGeneratorTests
[Fact]
public void TrainerGeneratorBasicNamedParameterTest()
{
var context = new MLContext(1);
var context = new MLContext();

var elementProperties = new Dictionary<string, object>()
{
Expand All @@ -37,7 +37,7 @@ public void TrainerGeneratorBasicNamedParameterTest()
[Fact]
public void TrainerGeneratorBasicAdvancedParameterTest()
{
var context = new MLContext(1);
var context = new MLContext();

var elementProperties = new Dictionary<string, object>()
{
Expand All @@ -58,7 +58,7 @@ public void TrainerGeneratorBasicAdvancedParameterTest()
[Fact]
public void TransformGeneratorBasicTest()
{
var context = new MLContext(1);
var context = new MLContext();
var elementProperties = new Dictionary<string, object>();
PipelineNode node = new PipelineNode("Normalizing", PipelineNodeType.Transform, new string[] { "Label" }, new string[] { "Label" }, elementProperties);
Pipeline pipeline = new Pipeline(new PipelineNode[] { node });
Expand All @@ -72,7 +72,7 @@ public void TransformGeneratorBasicTest()
[Fact]
public void TransformGeneratorUsingTest()
{
var context = new MLContext(1);
var context = new MLContext();
var elementProperties = new Dictionary<string, object>();
PipelineNode node = new PipelineNode("OneHotEncoding", PipelineNodeType.Transform, new string[] { "Label" }, new string[] { "Label" }, elementProperties);
Pipeline pipeline = new Pipeline(new PipelineNode[] { node });
Expand Down Expand Up @@ -117,7 +117,7 @@ public void ClassLabelGenerationBasicTest()
[Fact]
public void TrainerComplexParameterTest()
{
var context = new MLContext(1);
var context = new MLContext();

var elementProperties = new Dictionary<string, object>()
{
Expand Down
Loading

0 comments on commit 4492586

Please sign in to comment.