29 instantiations of NumericMetric
Microsoft.Extensions.AI.Evaluation.Integration.Tests (20)
ResultsTests.cs (20)
342var metricA = new NumericMetric("Metric with value 0", 0, reason: "Because of reason A"); 343var metricB = new NumericMetric("Metric with value 1", 1, reason: "Because of reason B"); 344var metricC = new NumericMetric("Metric with value 2", 2, reason: "Because of reason C"); 345var metricD = new NumericMetric("Metric with value 3", 3, reason: "Because of reason D"); 346var metricE = new NumericMetric("Metric with value 4", 4, reason: "Because of reason E"); 347var metricF = new NumericMetric("Metric with value 5", 5, reason: "Because of reason F"); 348var metricG = new NumericMetric("Metric with value 6", 6, reason: "Because of reason G"); 349var metricH = new NumericMetric("Metric with no value", reason: "Because of reason H"); 378var metricA = new NumericMetric("Metric with value 0", 0, reason: "Because of reason A"); 379var metricB = new NumericMetric("Metric with value 1", 1, reason: "Because of reason B"); 380var metricC = new NumericMetric("Metric with value 2", 2, reason: "Because of reason C"); 381var metricD = new NumericMetric("Metric with value 3", 3, reason: "Because of reason D"); 382var metricE = new NumericMetric("Metric with value 4", 4, reason: "Because of reason E"); 383var metricF = new NumericMetric("Metric with value 5", 5, reason: "Because of reason F"); 384var metricG = new NumericMetric("Metric with value 6", 6, reason: "Because of reason G"); 385var metricH = new NumericMetric("Metric with no value", reason: "Because of reason H"); 446var metric5 = new NumericMetric("Metric with informational diagnostics only"); 499var metric5 = new NumericMetric("Metric with informational diagnostics only"); 547var metric3 = new NumericMetric("Metric with error diagnostics only", value: 5); 558var metric5 = new NumericMetric("Metric with informational diagnostics only", value: 4);
Microsoft.Extensions.AI.Evaluation.Quality (4)
RelevanceTruthAndCompletenessEvaluator.cs (3)
86var relevance = new NumericMetric(RelevanceMetricName); 87var truth = new NumericMetric(TruthMetricName); 88var completeness = new NumericMetric(CompletenessMetricName);
SingleNumericMetricEvaluator.cs (1)
56var metric = new NumericMetric(MetricName);
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (3)
ResultStoreTester.cs (1)
24NumericMetric numericMetric = new NumericMetric("numeric", value: 3);
ScenarioRunResultTests.cs (2)
24var numericMetric = new NumericMetric("numeric", value: 3); 88var numericMetric = new NumericMetric("numeric", value: 3);
Microsoft.Extensions.AI.Evaluation.Safety (2)
ContentSafetyService.cs (2)
84metric = new NumericMetric(metricName, doubleValue, reason); 97metric = new NumericMetric(metricName, doubleValue, reason);
72 references to NumericMetric
Microsoft.Extensions.AI.Evaluation (7)
EvaluationMetric.cs (1)
22[JsonDerivedType(typeof(NumericMetric), "numeric")]
NumericMetric.cs (6)
11/// <see cref="NumericMetric"/> can be used to represent any numeric value. The underlying type of a 12/// <see cref="NumericMetric"/>'s value is <see langword="double"/>. However, it can be used to represent any type of 16/// A common use case for <see cref="NumericMetric"/> is to represent numeric scores that fall within a well defined 21/// <param name="name">The name of the <see cref="NumericMetric"/>.</param> 22/// <param name="value">The value of the <see cref="NumericMetric"/>.</param> 25/// <see cref="NumericMetric"/>.
Microsoft.Extensions.AI.Evaluation.Integration.Tests (22)
ResultsTests.cs (22)
72case NumericMetric numericMetric: 108(m is NumericMetric s && s.Value is not null) || 342var metricA = new NumericMetric("Metric with value 0", 0, reason: "Because of reason A"); 343var metricB = new NumericMetric("Metric with value 1", 1, reason: "Because of reason B"); 344var metricC = new NumericMetric("Metric with value 2", 2, reason: "Because of reason C"); 345var metricD = new NumericMetric("Metric with value 3", 3, reason: "Because of reason D"); 346var metricE = new NumericMetric("Metric with value 4", 4, reason: "Because of reason E"); 347var metricF = new NumericMetric("Metric with value 5", 5, reason: "Because of reason F"); 348var metricG = new NumericMetric("Metric with value 6", 6, reason: "Because of reason G"); 349var metricH = new NumericMetric("Metric with no value", reason: "Because of reason H"); 378var metricA = new NumericMetric("Metric with value 0", 0, reason: "Because of reason A"); 379var metricB = new NumericMetric("Metric with value 1", 1, reason: "Because of reason B"); 380var metricC = new NumericMetric("Metric with value 2", 2, reason: "Because of reason C"); 381var metricD = new NumericMetric("Metric with value 3", 3, reason: "Because of reason D"); 382var metricE = new NumericMetric("Metric with value 4", 4, reason: "Because of reason E"); 383var metricF = new NumericMetric("Metric with value 5", 5, reason: "Because of reason F"); 384var metricG = new NumericMetric("Metric with value 6", 6, reason: "Because of reason G"); 385var metricH = new NumericMetric("Metric with no value", reason: "Because of reason H"); 446var metric5 = new NumericMetric("Metric with informational diagnostics only"); 499var metric5 = new NumericMetric("Metric with informational diagnostics only"); 547var metric3 = new NumericMetric("Metric with error diagnostics only", value: 5); 558var metric5 = new NumericMetric("Metric with informational diagnostics only", value: 4);
Microsoft.Extensions.AI.Evaluation.Quality (27)
CoherenceEvaluator.cs (2)
16/// <see cref="CoherenceEvaluator"/> returns a <see cref="NumericMetric"/> that contains a score for 'Coherence'. The 38/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
EquivalenceEvaluator.cs (2)
20/// <see cref="NumericMetric"/> that contains a score for the 'Equivalence'. The score is a number between 1 and 5, 41/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
EvaluationMetricExtensions.cs (1)
8internal static EvaluationMetricInterpretation InterpretScore(this NumericMetric metric)
FluencyEvaluator.cs (2)
16/// <see cref="FluencyEvaluator"/> returns a <see cref="NumericMetric"/> that contains a score for 'Fluency'. The score 37/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
GroundednessEvaluator.cs (2)
20/// <see cref="NumericMetric"/> that contains a score for the 'Groundedness'. The score is a number between 1 and 5, 41/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
RelevanceTruthAndCompletenessEvaluator.cs (13)
28/// <see cref="RelevanceTruthAndCompletenessEvaluator"/> returns three <see cref="NumericMetric"/>s that contain scores 52/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by 58/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by 64/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by 86var relevance = new NumericMetric(RelevanceMetricName); 87var truth = new NumericMetric(TruthMetricName); 88var completeness = new NumericMetric(CompletenessMetricName); 237NumericMetric relevance = result.Get<NumericMetric>(RelevanceMetricName); 252NumericMetric truth = result.Get<NumericMetric>(TruthMetricName); 267NumericMetric completeness = result.Get<NumericMetric>(CompletenessMetricName);
SingleNumericMetricEvaluator.cs (5)
15/// produces an <see cref="EvaluationResult"/> containing a single <see cref="NumericMetric"/>. 23/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> produced by this 56var metric = new NumericMetric(MetricName); 71NumericMetric metric = result.Get<NumericMetric>(MetricName);
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (7)
ResultStoreTester.cs (1)
24NumericMetric numericMetric = new NumericMetric("numeric", value: 3);
ScenarioRunResultTests.cs (6)
24var numericMetric = new NumericMetric("numeric", value: 3); 88var numericMetric = new NumericMetric("numeric", value: 3); 186NumericMetric numericMetric = first.Get<NumericMetric>("numeric"); 187NumericMetric deserializedNumericMetric = second.Get<NumericMetric>("numeric");
Microsoft.Extensions.AI.Evaluation.Safety (9)
ContentHarmEvaluator.cs (1)
47metric => metric is NumericMetric numericMetric ? numericMetric.InterpretContentHarmScore() : null);
ContentSafetyEvaluator.cs (1)
189NumericMetric numericMetric => numericMetric.InterpretContentSafetyScore(),
EvaluationMetricExtensions.cs (2)
12internal static EvaluationMetricInterpretation InterpretContentHarmScore(this NumericMetric metric) 36internal static EvaluationMetricInterpretation InterpretContentSafetyScore(this NumericMetric metric)
GroundednessProEvaluator.cs (1)
21/// a <see cref="NumericMetric"/> that contains a score for the groundedness. The score is a number between 1 and 5,
HateAndUnfairnessEvaluator.cs (1)
14/// <see cref="HateAndUnfairnessEvaluator"/> returns a <see cref="NumericMetric"/> with a value between 0 and 7, with
SelfHarmEvaluator.cs (1)
14/// <see cref="SelfHarmEvaluator"/> returns a <see cref="NumericMetric"/> with a value between 0 and 7, with 0
SexualEvaluator.cs (1)
14/// <see cref="SexualEvaluator"/> returns a <see cref="NumericMetric"/> with a value between 0 and 7, with 0 indicating
ViolenceEvaluator.cs (1)
14/// <see cref="ViolenceEvaluator"/> returns a <see cref="NumericMetric"/> with a value between 0 and 7, with 0