@@ -15,14 +15,14 @@ namespace Microsoft.ML.CLI.Commands.New
1515{
1616 internal class NewCommand : ICommand
1717 {
18- private NewCommandOptions options ;
18+ private NewCommandSettings settings ;
1919 private static Logger logger = LogManager . GetCurrentClassLogger ( ) ;
2020 private TaskKind taskKind ;
2121
22- internal NewCommand ( NewCommandOptions options )
22+ internal NewCommand ( NewCommandSettings settings )
2323 {
24- this . options = options ;
25- this . taskKind = Utils . GetTaskKind ( options . MlTask ) ;
24+ this . settings = settings ;
25+ this . taskKind = Utils . GetTaskKind ( settings . MlTask ) ;
2626 }
2727
2828 public void Execute ( )
@@ -54,7 +54,7 @@ public void Execute()
5454
5555 // Explore the models
5656 ( Pipeline , ITransformer ) result = default ;
57- Console . WriteLine ( $ "{ Strings . ExplorePipeline } : { options . MlTask } ") ;
57+ Console . WriteLine ( $ "{ Strings . ExplorePipeline } : { settings . MlTask } ") ;
5858 try
5959 {
6060 result = ExploreModels ( context , trainData , validationData , sanitized_Label_Name ) ;
@@ -75,7 +75,7 @@ public void Execute()
7575
7676 // Save the model
7777 logger . Log ( LogLevel . Info , Strings . SavingBestModel ) ;
78- Utils . SaveModel ( model , options . OutputPath . FullName , $ "model.zip", context ) ;
78+ Utils . SaveModel ( model , settings . OutputPath . FullName , $ "model.zip", context ) ;
7979
8080 // Generate the Project
8181 GenerateProject ( columnInference , pipeline , sanitized_Label_Name ) ;
@@ -86,14 +86,14 @@ internal ColumnInferenceResults InferColumns(MLContext context)
8686 //Check what overload method of InferColumns needs to be called.
8787 logger . Log ( LogLevel . Info , Strings . InferColumns ) ;
8888 ColumnInferenceResults columnInference = null ;
89- var dataset = options . Dataset . FullName ;
90- if ( options . LabelColumnName != null )
89+ var dataset = settings . Dataset . FullName ;
90+ if ( settings . LabelColumnName != null )
9191 {
92- columnInference = context . AutoInference ( ) . InferColumns ( dataset , options . LabelColumnName , groupColumns : false ) ;
92+ columnInference = context . AutoInference ( ) . InferColumns ( dataset , settings . LabelColumnName , groupColumns : false ) ;
9393 }
9494 else
9595 {
96- columnInference = context . AutoInference ( ) . InferColumns ( dataset , options . LabelColumnIndex , hasHeader : options . HasHeader , groupColumns : false ) ;
96+ columnInference = context . AutoInference ( ) . InferColumns ( dataset , settings . LabelColumnIndex , hasHeader : settings . HasHeader , groupColumns : false ) ;
9797 }
9898
9999 return columnInference ;
@@ -102,17 +102,17 @@ internal ColumnInferenceResults InferColumns(MLContext context)
102102 internal void GenerateProject ( ColumnInferenceResults columnInference , Pipeline pipeline , string labelName )
103103 {
104104 //Generate code
105- logger . Log ( LogLevel . Info , $ "{ Strings . GenerateProject } : { options . OutputPath . FullName } ") ;
105+ logger . Log ( LogLevel . Info , $ "{ Strings . GenerateProject } : { settings . OutputPath . FullName } ") ;
106106 var codeGenerator = new CodeGenerator . CSharp . CodeGenerator (
107107 pipeline ,
108108 columnInference ,
109- new CodeGeneratorOptions ( )
109+ new CodeGeneratorSettings ( )
110110 {
111- TrainDataset = options . Dataset ,
111+ TrainDataset = settings . Dataset ,
112112 MlTask = taskKind ,
113- TestDataset = options . TestDataset ,
114- OutputName = options . Name ,
115- OutputBaseDir = options . OutputPath . FullName ,
113+ TestDataset = settings . TestDataset ,
114+ OutputName = settings . Name ,
115+ OutputBaseDir = settings . OutputPath . FullName ,
116116 LabelName = labelName
117117 } ) ;
118118 codeGenerator . GenerateOutput ( ) ;
@@ -130,7 +130,7 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
130130 var result = context . AutoInference ( )
131131 . CreateBinaryClassificationExperiment ( new BinaryExperimentSettings ( )
132132 {
133- MaxInferenceTimeInSeconds = options . MaxExplorationTime ,
133+ MaxInferenceTimeInSeconds = settings . MaxExplorationTime ,
134134 ProgressHandler = progressReporter
135135 } )
136136 . Execute ( trainData , validationData , new ColumnInformation ( ) { LabelColumn = labelName } ) ;
@@ -146,7 +146,7 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
146146 var result = context . AutoInference ( )
147147 . CreateRegressionExperiment ( new RegressionExperimentSettings ( )
148148 {
149- MaxInferenceTimeInSeconds = options . MaxExplorationTime ,
149+ MaxInferenceTimeInSeconds = settings . MaxExplorationTime ,
150150 ProgressHandler = progressReporter
151151 } ) . Execute ( trainData , validationData , new ColumnInformation ( ) { LabelColumn = labelName } ) ;
152152 logger . Log ( LogLevel . Info , Strings . RetrieveBestPipeline ) ;
@@ -170,8 +170,8 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
170170 var textLoader = context . Data . CreateTextLoader ( textLoaderArgs ) ;
171171
172172 logger . Log ( LogLevel . Info , Strings . LoadData ) ;
173- var trainData = textLoader . Read ( options . Dataset . FullName ) ;
174- var validationData = options . ValidationDataset == null ? null : textLoader . Read ( options . ValidationDataset . FullName ) ;
173+ var trainData = textLoader . Read ( settings . Dataset . FullName ) ;
174+ var validationData = settings . ValidationDataset == null ? null : textLoader . Read ( settings . ValidationDataset . FullName ) ;
175175
176176 return ( trainData , validationData ) ;
177177 }
0 commit comments