/// <summary>
        /// Select the best run from an enumeration of experiment cross validation runs.
        /// </summary>
        /// <param name="results">Enumeration of AutoML experiment cross validation run results.</param>
        /// <param name="metric">Metric to consider when selecting the best run.</param>
        /// <returns>The best experiment run.</returns>
        public static CrossValidationRunDetail <RegressionMetrics> Best(this IEnumerable <CrossValidationRunDetail <RegressionMetrics> > results, RegressionMetric metric = RegressionMetric.RSquared)
        {
            var metricsAgent       = new RegressionMetricsAgent(null, metric);
            var isMetricMaximizing = new OptimizingMetricInfo(metric).IsMaximizing;

            return(BestResultUtil.GetBestRun(results, metricsAgent, isMetricMaximizing));
        }
Example #2
0
        public static RunDetail <RegressionMetrics> GetBestRun(IEnumerable <RunDetail <RegressionMetrics> > results,
                                                               RegressionMetric metric)
        {
            var metricsAgent = new RegressionMetricsAgent(null, metric);
            var metricInfo   = new OptimizingMetricInfo(metric);

            return(GetBestRun(results, metricsAgent, metricInfo.IsMaximizing));
        }