@@ -67,26 +67,52 @@ public IEnumerable<IterationResult<T>> Fit()
67
67
68
68
do
69
69
{
70
- // get next pipeline
71
- var iterationsRemaining = ( int ) _settings . StoppingCriteria . MaxIterations - _history . Count ;
72
- var pipeline = PipelineSuggester . GetNextInferredPipeline ( _history , columns , _task , iterationsRemaining , _optimizingMetricInfo . IsMaximizing ) ;
70
+ SuggestedPipeline pipeline = null ;
71
+ SuggestedPipelineResult < T > runResult = null ;
73
72
74
- // break if no candidates returned, means no valid pipeline available
75
- if ( pipeline == null )
73
+ try
76
74
{
77
- break ;
78
- }
75
+ var iterationStopwatch = Stopwatch . StartNew ( ) ;
76
+ var getPiplelineStopwatch = Stopwatch . StartNew ( ) ;
77
+
78
+ // get next pipeline
79
+ var iterationsRemaining = ( int ) _settings . StoppingCriteria . MaxIterations - _history . Count ;
80
+ pipeline = PipelineSuggester . GetNextInferredPipeline ( _history , columns , _task , iterationsRemaining , _optimizingMetricInfo . IsMaximizing ) ;
81
+
82
+ getPiplelineStopwatch . Stop ( ) ;
83
+
84
+ // break if no candidates returned, means no valid pipeline available
85
+ if ( pipeline == null )
86
+ {
87
+ break ;
88
+ }
89
+
90
+ // evaluate pipeline
91
+ runResult = ProcessPipeline ( pipeline ) ;
79
92
80
- // evaluate pipeline
81
- SuggestedPipelineResult < T > runResult = ProcessPipeline ( pipeline ) ;
93
+ if ( preprocessorTransform != null )
94
+ {
95
+ runResult . Model = preprocessorTransform . Append ( runResult . Model ) ;
96
+ }
82
97
83
- if ( preprocessorTransform != null )
98
+ runResult . RuntimeInSeconds = ( int ) iterationStopwatch . Elapsed . TotalSeconds ;
99
+ runResult . GetPipelineTimeInSeconds = ( int ) getPiplelineStopwatch . Elapsed . TotalSeconds ;
100
+ }
101
+ catch ( Exception ex )
84
102
{
85
- runResult . Model = preprocessorTransform . Append ( runResult . Model ) ;
103
+ WriteDebugLog ( DebugStream . Exception , $ "{ pipeline ? . Trainer } Crashed { ex } ") ;
104
+
105
+ if ( runResult == null )
106
+ {
107
+ runResult = new SuggestedPipelineResult < T > ( null , null , pipeline , - 1 , ex ) ;
108
+ }
109
+ else
110
+ {
111
+ runResult = new SuggestedPipelineResult < T > ( runResult . EvaluatedMetrics , runResult . Model , runResult . Pipeline , runResult . Score , ex ) ;
112
+ }
86
113
}
87
114
88
115
yield return runResult . ToIterationResult ( ) ;
89
-
90
116
} while ( _history . Count < _settings . StoppingCriteria . MaxIterations &&
91
117
stopwatch . Elapsed . TotalMinutes < _settings . StoppingCriteria . TimeOutInMinutes ) ;
92
118
}
@@ -96,6 +122,10 @@ private SuggestedPipelineResult<T> ProcessPipeline(SuggestedPipeline pipeline)
96
122
// run pipeline
97
123
var stopwatch = Stopwatch . StartNew ( ) ;
98
124
125
+ var commandLineStr = $ "{ string . Join ( " xf=" , pipeline . Transforms ) } tr={ pipeline . Trainer } ";
126
+
127
+ WriteDebugLog ( DebugStream . RunResult , $ "Processing pipeline { commandLineStr } .") ;
128
+
99
129
SuggestedPipelineResult < T > runResult ;
100
130
try
101
131
{
0 commit comments