/// <summary> /// Select the best run from an enumeration of experiment runs. /// </summary> /// <param name="results">Enumeration of AutoML experiment run results.</param> /// <param name="metric">Metric to consider when selecting the best run.</param> /// <param name="groupIdColumnName">Name for the GroupId column.</param> /// <returns>The best experiment run.</returns> public static RunDetail <RankingMetrics> Best(this IEnumerable <RunDetail <RankingMetrics> > results, RankingMetric metric = RankingMetric.Ndcg, string groupIdColumnName = "GroupId") { var metricsAgent = new RankingMetricsAgent(null, metric, groupIdColumnName); var isMetricMaximizing = new OptimizingMetricInfo(metric).IsMaximizing; return(BestResultUtil.GetBestRun(results, metricsAgent, isMetricMaximizing)); }
/// <summary> /// Select the best run from an enumeration of experiment runs. /// </summary> /// <param name="results">Enumeration of AutoML experiment run results.</param> /// <param name="metric">Metric to consider when selecting the best run.</param> /// <param name="optimizationMetricTruncationLevel">Maximum truncation level for computing (N)DCG. Defaults to 10.</param> /// <returns>The best experiment run.</returns> public static RunDetail <RankingMetrics> Best(this IEnumerable <RunDetail <RankingMetrics> > results, RankingMetric metric = RankingMetric.Ndcg, uint optimizationMetricTruncationLevel = 10) { var metricsAgent = new RankingMetricsAgent(null, metric, optimizationMetricTruncationLevel); var isMetricMaximizing = new OptimizingMetricInfo(metric).IsMaximizing; return(BestResultUtil.GetBestRun(results, metricsAgent, isMetricMaximizing)); }
/// <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)); }
private protected override RunDetail <RankingMetrics> GetBestRun(IEnumerable <RunDetail <RankingMetrics> > results) { return(BestResultUtil.GetBestRun(results, MetricsAgent, OptimizingMetricInfo.IsMaximizing)); }
private protected override CrossValidationRunDetail <BinaryClassificationMetrics> GetBestCrossValRun(IEnumerable <CrossValidationRunDetail <BinaryClassificationMetrics> > results) { return(BestResultUtil.GetBestRun(results, MetricsAgent, OptimizingMetricInfo.IsMaximizing)); }