public TLExperimentsResultsCollection ComputeResults()
        {
            TLExperimentsResultsCollection allResults = new TLExperimentsResultsCollection();

            foreach (GroupOfTracingResults <T> tracingResults in m_allTracingResults)
            {
                var datasetResults = ComputeMetricResultsForDataset(tracingResults);
                allResults.Add(datasetResults);
            }

            return(allResults);
        }
Esempio n. 2
0
 /// <summary>
 /// Generates a TLExperimentsResultsCollection containing summary data of results.
 /// This operation is thread-safe.
 /// </summary>
 /// <returns>Results summaries</returns>
 public TLExperimentsResultsCollection GenerateSummaryResults()
 {
     lock (_lock)
     {
         TLExperimentsResultsCollection ExperimentsResultsCollection = new TLExperimentsResultsCollection();
         // iterate over techniques
         foreach (string technique in _techniques)
         {
             TLExperimentResults TechniqueResults = new TLExperimentResults(technique);
             // iterate over datasets
             foreach (string dataset in _datasets)
             {
                 // get list of results for technique + dataset
                 List <IMetricComputation> list = null;
                 string key = ComputeKey(technique, dataset);
                 _results.TryGetValue(key, out list);
                 if (list != null)
                 {
                     DatasetResults data = new DatasetResults(dataset);
                     // add results to dataset
                     foreach (IMetricComputation computation in list)
                     {
                         if (!computation.HasRun)
                         {
                             computation.Compute();
                         }
                         data.AddMetric(computation.GenerateSummary());
                     }
                     // add dataset to technique
                     if (data.Metrics.Count() > 0)
                     {
                         TechniqueResults.AddDatasetResult(data);
                     }
                 }
             }
             // add technique to collection
             if (TechniqueResults.DatasetsResults.Count() > 0)
             {
                 ExperimentsResultsCollection.Add(TechniqueResults);
             }
         }
         return(ExperimentsResultsCollection);
     }
 }
        public override void Compute()
        {
            //load dataset from workspace
            TLDatasetsList datasets = (TLDatasetsList)Workspace.Load("datasets");
            TLSimilarityMatricesCollection resultSimilarityMatrices = (TLSimilarityMatricesCollection)Workspace.Load("resultSimilarityMatrices");

            //wrap result similarity matrix into TracingResult
            var tracingResults = Adapt(resultSimilarityMatrices, "Current technique");

            MetricComputationEngine engine = new MetricComputationEngine(datasets, Logger, m_config);

            engine.AddTracingResults(tracingResults);

            TLExperimentsResultsCollection allExperimentResults = engine.ComputeResults();

            //set base data from which all metrics were computed from
            allExperimentResults["Current technique"].BaseData = resultSimilarityMatrices;

            //check if baseline results are in the workspace
            var baseline = (TLExperimentResults)Workspace.Load("BASELINE");

            if (baseline != null)
            {
                //if so, add them to collection of experiment results, so that it can be viewed by GUI component
                allExperimentResults.Add(baseline);

                TLSimilarityMatricesCollection baselineMatrices = baseline.BaseData as TLSimilarityMatricesCollection;

                //compute the score
                allExperimentResults["Current technique"].Score = ScoreComputation.ComputeScore(baselineMatrices, resultSimilarityMatrices, datasets, m_config);
            }
            else
            {
                allExperimentResults["Current technique"].Score = 0.0;
            }

            Workspace.Store("comparedResults", allExperimentResults);
            Workspace.Store("currentResults", allExperimentResults["Current technique"]);
        }
Esempio n. 4
0
 /// <summary>
 /// Generates a TLExperimentsResultsCollection containing summary data of results.
 /// This operation is thread-safe.
 /// </summary>
 /// <returns>Results summaries</returns>
 public TLExperimentsResultsCollection GenerateSummaryResults()
 {
     lock (_lock)
     {
         TLExperimentsResultsCollection ExperimentsResultsCollection = new TLExperimentsResultsCollection();
         // iterate over techniques
         foreach (string technique in _techniques)
         {
             TLExperimentResults TechniqueResults = new TLExperimentResults(technique);
             // iterate over datasets
             foreach (string dataset in _datasets)
             {
                 // get list of results for technique + dataset
                 List<IMetricComputation> list = null;
                 string key = ComputeKey(technique, dataset);
                 _results.TryGetValue(key, out list);
                 if (list != null)
                 {
                     DatasetResults data = new DatasetResults(dataset);
                     // add results to dataset
                     foreach (IMetricComputation computation in list)
                     {
                         if (!computation.HasRun)
                         {
                             computation.Compute();
                         }
                         data.AddMetric(computation.GenerateSummary());
                     }
                     // add dataset to technique
                     if (data.Metrics.Count() > 0)
                     {
                         TechniqueResults.AddDatasetResult(data);
                     }
                 }
             }
             // add technique to collection
             if (TechniqueResults.DatasetsResults.Count() > 0)
             {
                 ExperimentsResultsCollection.Add(TechniqueResults);
             }
         }
         return ExperimentsResultsCollection;
     }
 }