From 66088aaaf412969ecbdc30a2d265db850f1a8051 Mon Sep 17 00:00:00 2001 From: Nikolay Falaleev Date: Sun, 7 Apr 2024 00:49:36 +0100 Subject: [PATCH] docs: Improve example docstrings --- docs/source/guides.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/source/guides.rst b/docs/source/guides.rst index 3be383d..630b743 100644 --- a/docs/source/guides.rst +++ b/docs/source/guides.rst @@ -240,7 +240,11 @@ The code below demonstrates a top-K accuracy metric, which implements the requir class TopKAccuracy(Metric): - """Calculates the top-K accuracy for multiclass classification.""" + """Calculate the top-K accuracy for multiclass classification. + + Args: + k (int): Number of top predictions to consider. + """ name = 'top_k_accuracy' better = 'max' @@ -288,7 +292,13 @@ correct answer was present among the top-K predictions. class TopKAccuracy(Metric): - """Calculates the top-K accuracy for multiclass classification.""" + """Calculate the top-K accuracy for multiclass classification. + + It also reports the average rank of the correct top-K predictions. + + Args: + k (int): Number of top predictions to consider. + """ name = 'top_k_accuracy' better = 'max'