public QualityMetrics.Types.TopkMetrics DocNdcg { get; set; }
Normalized discounted cumulative gain (NDCG) per document, at various top-k
cutoff levels.
NDCG measures the ranking quality, giving higher relevance to top
results.
Example (top-3):
Suppose [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]
with three retrieved documents (D1, D2, D3) and binary relevance
judgements (1 for relevant, 0 for not relevant):
public QualityMetrics.Types.TopkMetrics DocPrecision { get; set; }
Precision per document, at various top-k cutoff levels.
Precision is the fraction of retrieved documents that are relevant.
Example (top-5):
For a single
[SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], If 4 out
of 5 retrieved documents in the top-5 are relevant, precision@5 = 4/5 =
0.8
public QualityMetrics.Types.TopkMetrics DocRecall { get; set; }
Recall per document, at various top-k cutoff levels.
Recall is the fraction of relevant documents retrieved out of all
relevant documents.
Example (top-5):
For a single
[SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], If 3 out
of 5 relevant documents are retrieved in the top-5, recall@5 = 3/5 = 0.6
public QualityMetrics.Types.TopkMetrics PageNdcg { get; set; }
Normalized discounted cumulative gain (NDCG) per page, at various top-k
cutoff levels.
NDCG measures the ranking quality, giving higher relevance to top
results.
Example (top-3):
Suppose [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]
with three retrieved pages (P1, P2, P3) and binary relevance judgements (1
for relevant, 0 for not relevant):
public QualityMetrics.Types.TopkMetrics PageRecall { get; set; }
Recall per page, at various top-k cutoff levels.
Recall is the fraction of relevant pages retrieved out of all relevant
pages.
Example (top-5):
For a single
[SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], if 3 out
of 5 relevant pages are retrieved in the top-5, recall@5 = 3/5 = 0.6
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eQualityMetrics\u003c/code\u003e class in the Discovery Engine v1beta API provides metrics for evaluating search result quality.\u003c/p\u003e\n"],["\u003cp\u003eThis class includes properties like \u003ccode\u003eDocNdcg\u003c/code\u003e, \u003ccode\u003eDocPrecision\u003c/code\u003e, and \u003ccode\u003eDocRecall\u003c/code\u003e which measure the relevance and ranking quality of retrieved documents.\u003c/p\u003e\n"],["\u003cp\u003eIt also offers \u003ccode\u003ePageNdcg\u003c/code\u003e and \u003ccode\u003ePageRecall\u003c/code\u003e to assess the performance of search results on a per-page basis.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version for the API class \u003ccode\u003eQualityMetrics\u003c/code\u003e is \u003ccode\u003e1.0.0-beta18\u003c/code\u003e, and another available version is \u003ccode\u003e1.0.0-beta17\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class QualityMetrics (1.0.0-beta19)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta19 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.QualityMetrics)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.QualityMetrics) \n\n public sealed class QualityMetrics : IMessage\u003cQualityMetrics\u003e, IEquatable\u003cQualityMetrics\u003e, IDeepCloneable\u003cQualityMetrics\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1beta API class QualityMetrics.\n\nDescribes the metrics produced by the evaluation. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e QualityMetrics \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[QualityMetrics](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.QualityMetrics), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[QualityMetrics](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.QualityMetrics), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[QualityMetrics](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.QualityMetrics), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1Beta](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1Beta.dll\n\nConstructors\n------------\n\n### QualityMetrics()\n\n public QualityMetrics()\n\n### QualityMetrics(QualityMetrics)\n\n public QualityMetrics(QualityMetrics other)\n\nProperties\n----------\n\n### DocNdcg\n\n public QualityMetrics.Types.TopkMetrics DocNdcg { get; set; }\n\nNormalized discounted cumulative gain (NDCG) per document, at various top-k\ncutoff levels.\n\nNDCG measures the ranking quality, giving higher relevance to top\nresults.\n\nExample (top-3):\nSuppose \\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\]\nwith three retrieved documents (D1, D2, D3) and binary relevance\njudgements (1 for relevant, 0 for not relevant):\n\nRetrieved: \\[D3 (0), D1 (1), D2 (1)\\]\nIdeal: \\[D1 (1), D2 (1), D3 (0)\\]\n\nCalculate NDCG@3 for each\n\\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\]:\n\n- DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13\n- Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63\n- NDCG@3: 1.13/1.63 = 0.693\n\n### DocPrecision\n\n public QualityMetrics.Types.TopkMetrics DocPrecision { get; set; }\n\nPrecision per document, at various top-k cutoff levels.\n\nPrecision is the fraction of retrieved documents that are relevant.\n\nExample (top-5):\n\n- For a single \\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\], If 4 out of 5 retrieved documents in the top-5 are relevant, precision@5 = 4/5 = 0.8\n\n### DocRecall\n\n public QualityMetrics.Types.TopkMetrics DocRecall { get; set; }\n\nRecall per document, at various top-k cutoff levels.\n\nRecall is the fraction of relevant documents retrieved out of all\nrelevant documents.\n\nExample (top-5):\n\n- For a single \\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\], If 3 out of 5 relevant documents are retrieved in the top-5, recall@5 = 3/5 = 0.6\n\n### PageNdcg\n\n public QualityMetrics.Types.TopkMetrics PageNdcg { get; set; }\n\nNormalized discounted cumulative gain (NDCG) per page, at various top-k\ncutoff levels.\n\nNDCG measures the ranking quality, giving higher relevance to top\nresults.\n\nExample (top-3):\nSuppose \\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\]\nwith three retrieved pages (P1, P2, P3) and binary relevance judgements (1\nfor relevant, 0 for not relevant):\n\nRetrieved: \\[P3 (0), P1 (1), P2 (1)\\]\nIdeal: \\[P1 (1), P2 (1), P3 (0)\\]\n\nCalculate NDCG@3 for\n\\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\]:\n\n- DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13\n- Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63\n- NDCG@3: 1.13/1.63 = 0.693\n\n### PageRecall\n\n public QualityMetrics.Types.TopkMetrics PageRecall { get; set; }\n\nRecall per page, at various top-k cutoff levels.\n\nRecall is the fraction of relevant pages retrieved out of all relevant\npages.\n\nExample (top-5):\n\n- For a single \\[SampleQuery\\]\\[google.cloud.discoveryengine.v1beta.SampleQuery\\], if 3 out of 5 relevant pages are retrieved in the top-5, recall@5 = 3/5 = 0.6"]]