private void MaxExperimentTimeExpiredEvent(object state) { // If at least one model was run, end experiment immediately. // Else, wait for first model to run before experiment is concluded. _experimentTimerExpired = true; if (_history.Any(r => r.RunSucceeded)) { _logger.Warning("Allocated time for Experiment of {0} seconds has elapsed with {1} models run. Ending experiment...", _experimentSettings.MaxExperimentTimeInSeconds, _history.Count()); _currentModelMLContext.CancelExecution(); } }
/// <summary> /// Stop the execution of pipeline in <see cref="MLContext"/> /// </summary> /// <param name="ctx"><see cref="MLContext"/> reference.</param> public static void CancelExecution(this MLContext ctx) => ctx.CancelExecution();