Esempio 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);
        }
Esempio 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());
        }
Esempio n. 3
0
        public BoxSummaryData Calculate(SingleTracingResults singleTechniqueResults, TLDataset dataset)
        {
            SortedDictionary <string, double> intermediateResults = m_metricComputation.Calculate(singleTechniqueResults.ResultMatrix, dataset);

            double[] dataPoints = intermediateResults.Values.ToArray();
            if (dataPoints.Length == 0 && m_logger != null)
            {
                m_logger.Warn("Metric computation of '" + m_metricName + "' returned zero matching results for " + dataset.Name + " for one of the techniques. It may be valid results, but it may also mean that there is mismatch of ids in the answer matrix and corresponding artifacts.");
            }

            var summaryData = new BoxSummaryData(m_metricName, m_metricDescription);

            summaryData.AddPoint(new BoxPlotPoint(dataPoints));

            return(summaryData);
        }