You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/09 03:02:17 UTC

[GitHub] eric-haibin-lin commented on a change in pull request #7390: adding ranking metrics (precision/recall) at position K.

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:
users@infra.apache.org


With regards,
Apache Git Services