1 type derived from EvaluationMetric
Microsoft.Extensions.AI.Evaluation (1)
EvaluationMetric{T}.cs (1)
16public class EvaluationMetric<T> : EvaluationMetric
4 instantiations of EvaluationMetric
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
ResultsTests.cs (2)
414var metric3 = new EvaluationMetric("Metric with error diagnostics only"); 461var metric3 = new EvaluationMetric("Metric with error diagnostics only");
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
ScenarioRunResultTests.cs (2)
29EvaluationMetric metricWithNoValue = new EvaluationMetric("none"); 68EvaluationMetric metricWithNoValue = new EvaluationMetric("none");
149 references to EvaluationMetric
Microsoft.Extensions.AI.Evaluation (95)
BooleanMetric.cs (1)
7/// An <see cref="EvaluationMetric"/> containing a <see cref="bool"/> value that can be used to represent an outcome
CompositeEvaluator.cs (8)
21/// Gets the <see cref="EvaluationMetric.Name"/>s of all the <see cref="EvaluationMetric"/>s produced by the 74/// containing one or more <see cref="EvaluationMetric"/>s. 78/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 102/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 110var metrics = new List<EvaluationMetric>(); 161var metric = new EvaluationMetric(metricName);
EvaluationDiagnostic.cs (1)
13/// in an <see cref="EvaluationMetric"/>.
EvaluationMetric.cs (6)
17/// <param name="name">The name of the <see cref="EvaluationMetric"/>.</param> 21[JsonDerivedType(typeof(EvaluationMetric), "none")] 25/// Gets or sets the name of the <see cref="EvaluationMetric"/>. 31/// evaluation represented by the current <see cref="EvaluationMetric"/> is considered good or bad, passed or 38/// <see cref="EvaluationMetric"/>. 48/// Adds a <see cref="EvaluationDiagnostic"/> to the current <see cref="EvaluationMetric"/>'s
EvaluationMetricExtensions.cs (3)
11/// Extension methods for <see cref="EvaluationMetric"/>. 20/// <param name="metric">The <see cref="EvaluationMetric"/> that is to be inspected.</param> 31this EvaluationMetric metric,
EvaluationMetricInterpretation.cs (6)
12/// Specifies how the result represented in an associated <see cref="EvaluationMetric"/> should be interpreted. 16/// <see cref="EvaluationMetric"/> is considered. 19/// <see langword="true"/> if the result represented in the associated <see cref="EvaluationMetric"/> is considered a 33/// associated <see cref="EvaluationMetric"/> is considered. 38/// Gets or sets a value indicating whether the result represented in the associated <see cref="EvaluationMetric"/> 42/// <see langword="true"/> if the result represented in the associated <see cref="EvaluationMetric"/> is considered
EvaluationRating.cs (1)
7/// An enumeration that identifies the set of possible ways in which an <see cref="EvaluationMetric"/> can be
EvaluationResult.cs (34)
12/// A collection of one or more <see cref="EvaluationMetric"/>s that represent the result of an evaluation. 17/// Gets or sets a collection of one or more <see cref="EvaluationMetric"/>s that represent the result of an 24public IDictionary<string, EvaluationMetric> Metrics { get; set; } 32/// A dictionary containing one or more <see cref="EvaluationMetric"/>s that represent the result of an evaluation. 35/// The dictionary is keyed on the <see cref="EvaluationMetric.Name"/>s of the contained 36/// <see cref="EvaluationMetric"/>s. 40public EvaluationResult(IDictionary<string, EvaluationMetric> metrics) 49/// An enumeration of <see cref="EvaluationMetric"/>s that represent the result of an evaluation. 51public EvaluationResult(IEnumerable<EvaluationMetric> metrics) 55var metricsDictionary = new Dictionary<string, EvaluationMetric>(); 57foreach (EvaluationMetric metric in metrics) 81/// An array of <see cref="EvaluationMetric"/>s that represent the result of an evaluation. 83public EvaluationResult(params EvaluationMetric[] metrics) 84: this(metrics as IEnumerable<EvaluationMetric>) 89/// Returns an <see cref="EvaluationMetric"/> with type <typeparamref name="T"/> and with the 90/// <see cref="EvaluationMetric.Name"/> specified via <paramref name="metricName"/> if it exists in 93/// <typeparam name="T">The type of the <see cref="EvaluationMetric"/> to be returned.</typeparam> 95/// The <see cref="EvaluationMetric.Name"/> of the <see cref="EvaluationMetric"/> to be returned. 98/// An <see cref="EvaluationMetric"/> with type <typeparamref name="T"/> and with the 99/// <see cref="EvaluationMetric.Name"/> specified via <paramref name="metricName"/> if it exists in 107where T : EvaluationMetric 109if (Metrics.TryGetValue(metricName, out EvaluationMetric? m) && m is T metric) 120/// Returns an <see cref="EvaluationMetric"/> with type <typeparamref name="T"/> and with the 121/// <see cref="EvaluationMetric.Name"/> specified via <paramref name="metricName"/> if it exists in 124/// <typeparam name="T">The type of the <see cref="EvaluationMetric"/> to be returned.</typeparam> 126/// The <see cref="EvaluationMetric.Name"/> of the <see cref="EvaluationMetric"/> to be returned. 129/// An <see cref="EvaluationMetric"/> with type <typeparamref name="T"/> and with the 130/// <see cref="EvaluationMetric.Name"/> specified via <paramref name="metricName"/> if it exists in 134/// An <see cref="EvaluationMetric"/> with type <typeparamref name="T"/> and with the 135/// <see cref="EvaluationMetric.Name"/> specified via <paramref name="metricName"/> does not exist in 139where T : EvaluationMetric 141if (Metrics.TryGetValue(metricName, out EvaluationMetric? m) && m is T metric)
EvaluationResultExtensions.cs (11)
16/// Adds the supplied <paramref name="diagnostic"/> to all <see cref="EvaluationMetric"/>s contained in the 20/// The <see cref="EvaluationResult"/> containing the <see cref="EvaluationMetric"/>s that are to be altered. 27foreach (EvaluationMetric metric in result.Metrics.Values) 34/// Returns <see langword="true"/> if any <see cref="EvaluationMetric"/> contained in the supplied 44/// <see langword="true"/> if any <see cref="EvaluationMetric"/> contained in the supplied 58/// Applies <see cref="EvaluationMetricInterpretation"/>s to one or more <see cref="EvaluationMetric"/>s contained 62/// The <see cref="EvaluationResult"/> containing the <see cref="EvaluationMetric"/>s that are to be interpreted. 66/// supplied <see cref="EvaluationMetric"/>, or <see langword="null"/> if the 67/// <see cref="EvaluationMetric.Interpretation"/> should be left unchanged.</param> 70Func<EvaluationMetric, EvaluationMetricInterpretation?> interpretationProvider) 75foreach (EvaluationMetric metric in result.Metrics.Values)
EvaluatorExtensions.cs (16)
18/// containing one or more <see cref="EvaluationMetric"/>s. 22/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 43/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 58/// containing one or more <see cref="EvaluationMetric"/>s. 62/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 86/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 103/// containing one or more <see cref="EvaluationMetric"/>s. 107/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 128/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 148/// containing one or more <see cref="EvaluationMetric"/>s. 152/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 176/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns>
IEvaluator.cs (6)
16/// Gets the <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s produced by this 23/// containing one or more <see cref="EvaluationMetric"/>s. 27/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 50/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns>
NumericMetric.cs (1)
7/// An <see cref="EvaluationMetric"/> containing a numeric value.
StringMetric.cs (1)
7/// An <see cref="EvaluationMetric"/> containing a <see cref="string"/> value.
Microsoft.Extensions.AI.Evaluation.Integration.Tests (7)
ResultsTests.cs (6)
32private static EvaluationMetricInterpretation? FailIfValueIsTrue(EvaluationMetric m) 58private static EvaluationMetricInterpretation? FailIfValueIsLessThan4(EvaluationMetric m) 99private static EvaluationMetricInterpretation? FailIfValueIsMissing(EvaluationMetric m) => 119private static EvaluationMetricInterpretation? FailIfNotImperialOrUSCustomary(EvaluationMetric m) 414var metric3 = new EvaluationMetric("Metric with error diagnostics only"); 461var metric3 = new EvaluationMetric("Metric with error diagnostics only");
TestEvaluator.cs (1)
14public IReadOnlyList<EvaluationMetric> TestMetrics { get; set; } = [];
Microsoft.Extensions.AI.Evaluation.Quality (14)
ChatConversationEvaluator.cs (6)
306/// <see cref="EvaluationMetric"/>s supported by this <see cref="IEvaluator"/>. 309/// The <see cref="EvaluationMetric.Name"/>s of the <see cref="EvaluationMetric"/>s contained in the returned 314/// <see cref="EvaluationMetric"/>s supported by this <see cref="IEvaluator"/>. 321/// <see cref="EvaluationMetric"/>s in the supplied <paramref name="result"/>. 332/// An <see cref="EvaluationResult"/> that includes a collection of <see cref="EvaluationMetric"/>s that are
CoherenceEvaluator.cs (1)
20/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
EquivalenceEvaluator.cs (1)
24/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
FluencyEvaluator.cs (1)
20/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
GroundednessEvaluator.cs (1)
24/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
RelevanceTruthAndCompletenessEvaluator.cs (3)
32/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by 38/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by 44/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> returned by
SingleNumericMetricEvaluator.cs (1)
21/// Gets the <see cref="EvaluationMetric.Name"/> of the <see cref="NumericMetric"/> produced by this
Microsoft.Extensions.AI.Evaluation.Reporting (27)
Formats\Html\HtmlReportWriter.cs (1)
18/// <see cref="EvaluationMetric"/>s present in the supplied <see cref="ScenarioRunResult"/>s and writes it to the
Formats\Json\JsonReportWriter.cs (1)
17/// <see cref="EvaluationMetric"/>s present in the supplied <see cref="ScenarioRunResult"/>s and writes it to the
IEvaluationReportWriter.cs (2)
11/// Generates a report containing all the <see cref="EvaluationMetric"/>s present in the supplied 17/// Writes a report containing all the <see cref="EvaluationMetric"/>s present in the supplied
ReportingConfiguration.cs (8)
80/// <see cref="EvaluationMetric"/>s returned from evaluations that use this <see cref="ReportingConfiguration"/>. 84/// <see cref="EvaluationMetric"/> that is supplied to it, or return <see langword="null"/> if the 85/// <see cref="EvaluationMetric.Interpretation"/> should be left unchanged. 87public Func<EvaluationMetric, EvaluationMetricInterpretation?>? EvaluationMetricInterpreter { get; } 118/// <see cref="EvaluationMetric"/>s returned from evaluations that use this <see cref="ReportingConfiguration"/>. 120/// <see cref="EvaluationMetric"/> that is supplied to it, or return <see langword="null"/> if the 121/// <see cref="EvaluationMetric.Interpretation"/> should be left unchanged. 130Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null)
ScenarioRun.cs (5)
67/// across these different executions to track how the <see cref="EvaluationMetric"/>s for each scenario and 87private readonly Func<EvaluationMetric, EvaluationMetricInterpretation?>? _evaluationMetricInterpreter; 98Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null) 112/// containing one or more <see cref="EvaluationMetric"/>s. 126/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns>
ScenarioRunExtensions.cs (8)
18/// containing one or more <see cref="EvaluationMetric"/>s. 29/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 42/// containing one or more <see cref="EvaluationMetric"/>s. 57/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 72/// containing one or more <see cref="EvaluationMetric"/>s. 83/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns> 101/// containing one or more <see cref="EvaluationMetric"/>s. 116/// <returns>An <see cref="EvaluationResult"/> containing one or more <see cref="EvaluationMetric"/>s.</returns>
ScenarioRunResultExtensions.cs (2)
15/// Returns <see langword="true"/> if any <see cref="EvaluationMetric"/> contained in the supplied 25/// <see langword="true"/> if any <see cref="EvaluationMetric"/> contained in the supplied
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (6)
ScenarioRunResultTests.cs (6)
29EvaluationMetric metricWithNoValue = new EvaluationMetric("none"); 68EvaluationMetric metricWithNoValue = new EvaluationMetric("none"); 144EvaluationMetric metricWithNoValue = first.Get<EvaluationMetric>("none"); 145EvaluationMetric deserializedMetricWithNoValue = second.Get<EvaluationMetric>("none");