Exemplo n.º 1
0
        /// <summary>
        /// Gets the metric computation.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <returns></returns>
        private static IMetricComputation GetMetricComputation(MetricComputationComponentConfig config)
        {
            IMetricComputation metricComputation;

            if (config.ScoreBaseMetric == ScoreBaseMetric.PrecisionAtRecall100)
            {
                metricComputation = new PrecisionAtRecall100();
            }
            else if (config.ScoreBaseMetric == ScoreBaseMetric.Precision)
            {
                metricComputation = new Precision(config.Threshold);
            }
            else if (config.ScoreBaseMetric == ScoreBaseMetric.Recall)
            {
                metricComputation = new Recall(config.Threshold);
            }
            else
            {
                metricComputation = new AveragePrecision();
            }
            return(metricComputation);
        }
 /// <summary>
 /// Gets the metric computation.
 /// </summary>
 /// <param name="config">The config.</param>
 /// <returns></returns>
 private static IMetricComputation GetMetricComputation(MetricComputationComponentConfig config)
 {
     IMetricComputation metricComputation;
     if (config.ScoreBaseMetric == ScoreBaseMetric.PrecisionAtRecall100)
     {
         metricComputation = new PrecisionAtRecall100();
     }
     else if (config.ScoreBaseMetric == ScoreBaseMetric.Precision)
     {
         metricComputation = new Precision(config.Threshold);
     }
     else if (config.ScoreBaseMetric == ScoreBaseMetric.Recall)
     {
         metricComputation = new Recall(config.Threshold);
     }
     else
     {
         metricComputation = new AveragePrecision();
     }
     return metricComputation;
 }