Skip to content

Commit

Permalink
docs: Improve example docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolasEnt committed Apr 6, 2024
1 parent 748bd4a commit 66088aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/source/guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 66088aa

Please sign in to comment.