@@ -15,14 +15,14 @@ namespace Microsoft.ML.CLI.Commands.New
15
15
{
16
16
internal class NewCommand : ICommand
17
17
{
18
- private NewCommandOptions options ;
18
+ private NewCommandSettings settings ;
19
19
private static Logger logger = LogManager . GetCurrentClassLogger ( ) ;
20
20
private TaskKind taskKind ;
21
21
22
- internal NewCommand ( NewCommandOptions options )
22
+ internal NewCommand ( NewCommandSettings settings )
23
23
{
24
- this . options = options ;
25
- this . taskKind = Utils . GetTaskKind ( options . MlTask ) ;
24
+ this . settings = settings ;
25
+ this . taskKind = Utils . GetTaskKind ( settings . MlTask ) ;
26
26
}
27
27
28
28
public void Execute ( )
@@ -54,7 +54,7 @@ public void Execute()
54
54
55
55
// Explore the models
56
56
( Pipeline , ITransformer ) result = default ;
57
- Console . WriteLine ( $ "{ Strings . ExplorePipeline } : { options . MlTask } ") ;
57
+ Console . WriteLine ( $ "{ Strings . ExplorePipeline } : { settings . MlTask } ") ;
58
58
try
59
59
{
60
60
result = ExploreModels ( context , trainData , validationData , sanitized_Label_Name ) ;
@@ -75,7 +75,7 @@ public void Execute()
75
75
76
76
// Save the model
77
77
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 ) ;
79
79
80
80
// Generate the Project
81
81
GenerateProject ( columnInference , pipeline , sanitized_Label_Name ) ;
@@ -86,14 +86,14 @@ internal ColumnInferenceResults InferColumns(MLContext context)
86
86
//Check what overload method of InferColumns needs to be called.
87
87
logger . Log ( LogLevel . Info , Strings . InferColumns ) ;
88
88
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 )
91
91
{
92
- columnInference = context . AutoInference ( ) . InferColumns ( dataset , options . LabelColumnName , groupColumns : false ) ;
92
+ columnInference = context . AutoInference ( ) . InferColumns ( dataset , settings . LabelColumnName , groupColumns : false ) ;
93
93
}
94
94
else
95
95
{
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 ) ;
97
97
}
98
98
99
99
return columnInference ;
@@ -102,17 +102,17 @@ internal ColumnInferenceResults InferColumns(MLContext context)
102
102
internal void GenerateProject ( ColumnInferenceResults columnInference , Pipeline pipeline , string labelName )
103
103
{
104
104
//Generate code
105
- logger . Log ( LogLevel . Info , $ "{ Strings . GenerateProject } : { options . OutputPath . FullName } ") ;
105
+ logger . Log ( LogLevel . Info , $ "{ Strings . GenerateProject } : { settings . OutputPath . FullName } ") ;
106
106
var codeGenerator = new CodeGenerator . CSharp . CodeGenerator (
107
107
pipeline ,
108
108
columnInference ,
109
- new CodeGeneratorOptions ( )
109
+ new CodeGeneratorSettings ( )
110
110
{
111
- TrainDataset = options . Dataset ,
111
+ TrainDataset = settings . Dataset ,
112
112
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 ,
116
116
LabelName = labelName
117
117
} ) ;
118
118
codeGenerator . GenerateOutput ( ) ;
@@ -130,7 +130,7 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
130
130
var result = context . AutoInference ( )
131
131
. CreateBinaryClassificationExperiment ( new BinaryExperimentSettings ( )
132
132
{
133
- MaxInferenceTimeInSeconds = options . MaxExplorationTime ,
133
+ MaxInferenceTimeInSeconds = settings . MaxExplorationTime ,
134
134
ProgressHandler = progressReporter
135
135
} )
136
136
. Execute ( trainData , validationData , new ColumnInformation ( ) { LabelColumn = labelName } ) ;
@@ -146,7 +146,7 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
146
146
var result = context . AutoInference ( )
147
147
. CreateRegressionExperiment ( new RegressionExperimentSettings ( )
148
148
{
149
- MaxInferenceTimeInSeconds = options . MaxExplorationTime ,
149
+ MaxInferenceTimeInSeconds = settings . MaxExplorationTime ,
150
150
ProgressHandler = progressReporter
151
151
} ) . Execute ( trainData , validationData , new ColumnInformation ( ) { LabelColumn = labelName } ) ;
152
152
logger . Log ( LogLevel . Info , Strings . RetrieveBestPipeline ) ;
@@ -170,8 +170,8 @@ internal void GenerateProject(ColumnInferenceResults columnInference, Pipeline p
170
170
var textLoader = context . Data . CreateTextLoader ( textLoaderArgs ) ;
171
171
172
172
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 ) ;
175
175
176
176
return ( trainData , validationData ) ;
177
177
}
0 commit comments