18 using TraceLab.Components.DevelopmentKit.Metrics;
19 using TraceLab.Components.DevelopmentKit.Metrics.Traceability;
20 using TraceLab.Components.Library.Metrics.Controller;
22 using TraceLabSDK.Types;
23 using TraceLabSDK.Types.Contests;
25 namespace TraceLab.Components.Library.Metrics.Traceability
27 [Component(Name =
"Traceability Metrics - Ranklist granularity",
28 Description =
"Computes various traceability metrics on a similarity matrix at the ranklist granularity.",
29 Author =
"SEMERU; Evan Moritz",
31 ConfigurationType = typeof(TraceabilityMetricsRanklistConfig))]
32 [IOSpec(IOSpecType.Input,
"CandidateMatrix", typeof(TLSimilarityMatrix))]
33 [IOSpec(IOSpecType.Input,
"AnswerMatrix", typeof(TLSimilarityMatrix))]
34 [Tag(
"Metrics.Traceability")]
43 Configuration = _config;
48 Logger.Trace(
"Starting metrics computation: " + _config.TechniqueName);
49 TLSimilarityMatrix matrix = (TLSimilarityMatrix)Workspace.Load(
"CandidateMatrix");
50 TLSimilarityMatrix oracle = (TLSimilarityMatrix)Workspace.Load(
"AnswerMatrix");
51 TLExperimentResults exResults =
new TLExperimentResults(_config.TechniqueName);
53 if (_config.Precision)
55 Logger.Trace(
"Computing precision...");
62 Logger.Trace(
"Skipped precision computation.");
68 Logger.Trace(
"Computing recall...");
75 Logger.Trace(
"Skipped recall computation.");
78 #region Average Precision
79 if (_config.AveragePrecision)
81 Logger.Trace(
"Computing average precision...");
88 Logger.Trace(
"Skipped average precision computation.");
94 Logger.Trace(
"Computing precision-recall curve...");
101 Logger.Trace(
"Skipped precision-recall curve computation.");