@@ -54,7 +54,7 @@ public void GenerateOutput()
54
54
var namespaceValue = Utils . Normalize ( settings . OutputName ) ;
55
55
56
56
// Generate code for training and scoring
57
- var trainFileContent = GenerateTrainCode ( usings , trainer , transforms , columns , classLabels , namespaceValue ) ;
57
+ var trainFileContent = GenerateTrainCode ( usings , trainer , transforms , columns , classLabels , namespaceValue , pipeline . CacheBeforeTrainer ) ;
58
58
var tree = CSharpSyntaxTree . ParseText ( trainFileContent ) ;
59
59
var syntaxNode = tree . GetRoot ( ) ;
60
60
trainFileContent = Formatter . Format ( syntaxNode , new AdhocWorkspace ( ) ) . ToFullString ( ) ;
@@ -91,7 +91,7 @@ internal static string GeneratProjectCode()
91
91
return projectCodeGen . TransformText ( ) ;
92
92
}
93
93
94
- internal string GenerateTrainCode ( string usings , string trainer , List < string > transforms , IList < string > columns , IList < string > classLabels , string namespaceValue )
94
+ internal string GenerateTrainCode ( string usings , string trainer , List < string > transforms , IList < string > columns , IList < string > classLabels , string namespaceValue , bool cacheBeforeTrainer )
95
95
{
96
96
var trainingAndScoringCodeGen = new MLCodeGen ( )
97
97
{
@@ -110,7 +110,8 @@ internal string GenerateTrainCode(string usings, string trainer, List<string> tr
110
110
TaskType = settings . MlTask . ToString ( ) ,
111
111
Namespace = namespaceValue ,
112
112
LabelName = settings . LabelName ,
113
- ModelPath = settings . ModelPath
113
+ ModelPath = settings . ModelPath ,
114
+ CacheBeforeTrainer = cacheBeforeTrainer
114
115
} ;
115
116
116
117
return trainingAndScoringCodeGen . TransformText ( ) ;
0 commit comments