@@ -74,7 +74,8 @@ public void TestLearn()
7474 [ Fact ( Skip = "Need CoreTLC specific baseline update" ) ]
7575 public void TestTextDatasetLearn ( )
7676 {
77- using ( var env = new ConsoleEnvironment ( ) )
77+ using ( var env = new ConsoleEnvironment ( )
78+ . AddStandardComponents ( ) ) // AutoInference uses ComponentCatalog to find all learners
7879 {
7980 string pathData = GetDataPath ( @"../UnitTest/tweets_labeled_10k_test_validation.tsv" ) ;
8081 int batchSize = 5 ;
@@ -141,15 +142,16 @@ public void TestHyperparameterFreezing()
141142 int batchSize = 1 ;
142143 int numIterations = 10 ;
143144 int numTransformLevels = 3 ;
144- using ( var env = new ConsoleEnvironment ( ) )
145+ using ( var env = new ConsoleEnvironment ( verbose : true )
146+ . AddStandardComponents ( ) ) // AutoInference uses ComponentCatalog to find all learners
145147 {
146148 SupportedMetric metric = PipelineSweeperSupportedMetrics . GetSupportedMetric ( PipelineSweeperSupportedMetrics . Metrics . Auc ) ;
147149
148150 // Using the simple, uniform random sampling (with replacement) brain
149- PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( Env ) ;
151+ PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( env ) ;
150152
151153 // Run initial experiments
152- var amls = AutoInference . InferPipelines ( Env , autoMlBrain , pathData , "" , out var _ , numTransformLevels , batchSize ,
154+ var amls = AutoInference . InferPipelines ( env , autoMlBrain , pathData , "" , out var _ , numTransformLevels , batchSize ,
153155 metric , out var bestPipeline , numOfSampleRows , new IterationTerminator ( numIterations ) ,
154156 MacroUtils . TrainerKinds . SignatureBinaryClassifierTrainer ) ;
155157
@@ -189,15 +191,16 @@ public void TestRegressionPipelineWithMinimizingMetric()
189191 int batchSize = 5 ;
190192 int numIterations = 10 ;
191193 int numTransformLevels = 1 ;
192- using ( var env = new ConsoleEnvironment ( ) )
194+ using ( var env = new ConsoleEnvironment ( )
195+ . AddStandardComponents ( ) ) // AutoInference uses ComponentCatalog to find all learners
193196 {
194197 SupportedMetric metric = PipelineSweeperSupportedMetrics . GetSupportedMetric ( PipelineSweeperSupportedMetrics . Metrics . AccuracyMicro ) ;
195198
196199 // Using the simple, uniform random sampling (with replacement) brain
197- PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( Env ) ;
200+ PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( env ) ;
198201
199202 // Run initial experiments
200- var amls = AutoInference . InferPipelines ( Env , autoMlBrain , pathData , "" , out var _ , numTransformLevels , batchSize ,
203+ var amls = AutoInference . InferPipelines ( env , autoMlBrain , pathData , "" , out var _ , numTransformLevels , batchSize ,
201204 metric , out var bestPipeline , numOfSampleRows , new IterationTerminator ( numIterations ) ,
202205 MacroUtils . TrainerKinds . SignatureRegressorTrainer ) ;
203206
@@ -223,15 +226,16 @@ public void TestLearnerConstrainingByName()
223226 int numIterations = 1 ;
224227 int numTransformLevels = 2 ;
225228 var retainedLearnerNames = new [ ] { $ "LogisticRegressionBinaryClassifier", $ "FastTreeBinaryClassifier" } ;
226- using ( var env = new ConsoleEnvironment ( ) )
229+ using ( var env = new ConsoleEnvironment ( )
230+ . AddStandardComponents ( ) ) // AutoInference uses ComponentCatalog to find all learners
227231 {
228232 SupportedMetric metric = PipelineSweeperSupportedMetrics . GetSupportedMetric ( PipelineSweeperSupportedMetrics . Metrics . Auc ) ;
229233
230234 // Using the simple, uniform random sampling (with replacement) brain.
231- PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( Env ) ;
235+ PipelineOptimizerBase autoMlBrain = new UniformRandomEngine ( env ) ;
232236
233237 // Run initial experiment.
234- var amls = AutoInference . InferPipelines ( Env , autoMlBrain , pathData , "" , out var _ ,
238+ var amls = AutoInference . InferPipelines ( env , autoMlBrain , pathData , "" , out var _ ,
235239 numTransformLevels , batchSize , metric , out var _ , numOfSampleRows ,
236240 new IterationTerminator ( numIterations ) , MacroUtils . TrainerKinds . SignatureBinaryClassifierTrainer ) ;
237241
0 commit comments