Exemplo n.º 1
0
        /// <summary>
        /// Computes the score for the given current results.
        /// </summary>
        /// <param name="baselineMatrices">The baseline matrices.</param>
        /// <param name="currentResults">The current results.</param>
        /// <returns></returns>
        public static double ComputeScore(TLSimilarityMatricesCollection baselineMatrices, TLSimilarityMatricesCollection currentResultsMatrices,
                                          TLDatasetsList datasets, MetricComputationComponentConfig config)
        {
            double score = 0.0;

            double sum    = 0;
            double counts = 0;

            IMetricComputation metricComputation = GetMetricComputation(config);

            foreach (TLDataset dataset in datasets)
            {
                TLSimilarityMatrix baseline = baselineMatrices[dataset.Name];
                TLSimilarityMatrix current  = currentResultsMatrices[dataset.Name];

                //score is computed based on delta between two techniques from metric computation
                SortedDictionary <string, double> baselineValues = metricComputation.Calculate(baseline, dataset);
                SortedDictionary <string, double> currentValues  = metricComputation.Calculate(current, dataset);

                var deltas = ScoreComputationHelper.Delta(baselineValues, currentValues);

                //now compute average of computed deltas, and that's the score

                foreach (double delta in deltas.Values)
                {
                    sum += delta;
                }

                counts += deltas.Count;
            }

            score = sum / counts;

            return(score);
        }
Exemplo n.º 2
0
        private List <double> PrepareDataForWilcox(SingleTracingResults techniqueOneResults, SingleTracingResults techniqueTwoResults, TLDataset dataset)
        {
            var avePrec1 = (SortedDictionary <string, double>)m_baseMetricComputation.Calculate(techniqueOneResults.ResultMatrix, dataset);
            var avePrec2 = (SortedDictionary <string, double>)m_baseMetricComputation.Calculate(techniqueTwoResults.ResultMatrix, dataset);

            var deltas = ScoreComputationHelper.Delta(avePrec1, avePrec2);

            return(deltas.Values.ToList());
        }