srowen commented on a change in pull request #24458: [SPARK-27540][MLlib] Add
'meanAveragePrecision_at_k' metric to RankingMetrics
URL: https://github.com/apache/spark/pull/24458#discussion_r280539410
##########
File path:
examples/src/main/java/org/apache/spark/examples/mllib/JavaRankingMetricsExample.java
##########
@@ -110,6 +110,9 @@ public static void main(String[] args) {
// Mean average precision
System.out.format("Mean average precision = %f\n",
metrics.meanAveragePrecision());
+ //Mean average precision at k
+ System.out.format("Mean average precision at 2 = %f\n",
metrics.meanAveragePrecisionAt(2));
Review comment:
Nit: unindent
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]