eric-haibin-lin commented on a change in pull request #7390: adding ranking 
metrics (precision/recall) at position K. 
URL: https://github.com/apache/incubator-mxnet/pull/7390#discussion_r132081575
 
 

 ##########
 File path: python/mxnet/ranking_metrics.py
 ##########
 @@ -0,0 +1,45 @@
+"""
+A function that implements ranking metrics 
+(precision, recall, coverage and converted coverage) 
+for a given position K
+"""
+
+def metrics_at_k(Y,Yhat, K):
+       """
+       Parameters
+       ----------
+       Y       : dictionary with key = sample index and value = list of 
positive indices of features
+       Yhat: dict wit key = sample index and value = ORDERED list of indices 
of features, according to some score
+       K       : position at which to compute score
+       
+       Returns
+       -------
+       pre             : precision at K
+       rec             : recall at K
+       convcoverage: converted coverage at K
+       coverage        : coverage at K
+
+       Examples
+    --------
 
 Review comment:
   Thanks for contributing back! Could you fix pylint warnings? 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to