[ 
https://issues.apache.org/jira/browse/SPARK-3568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiangrui Meng resolved SPARK-3568.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.2.0

Issue resolved by pull request 2667
[https://github.com/apache/spark/pull/2667]

> Add metrics for ranking algorithms
> ----------------------------------
>
>                 Key: SPARK-3568
>                 URL: https://issues.apache.org/jira/browse/SPARK-3568
>             Project: Spark
>          Issue Type: New Feature
>          Components: MLlib
>            Reporter: Shuo Xiang
>            Assignee: Shuo Xiang
>             Fix For: 1.2.0
>
>
> Include common metrics for ranking algorithms 
> (http://www-nlp.stanford.edu/IR-book/), including:
>  - Mean Average Precision
>  - Precision@n: top-n precision
>  - Discounted cumulative gain (DCG) and NDCG 
> This implementation attempts to create a new class called *RankingMetrics* 
> under *org.apache.spark.mllib.evaluation*, which accepts input (prediction 
> and label pairs) as *RDD[Array[T], Array[T]]*. The following methods will be 
> implemented:
> {code:title=RankingMetrics.scala|borderStyle=solid}
> class RankingMetrics[T](predictionAndLabels: RDD[(Array[T], Array[T])]) {
>   /* Returns the precsion@k for each query */
>   lazy val precAtK: RDD[Array[Double]]
>   /**
>    * @param k the position to compute the truncated precision
>    * @return the average precision at the first k ranking positions
>    */
>   def precision(k: Int): Double
>   /* Returns the average precision for each query */
>   lazy val avePrec: RDD[Double]
>   /*Returns the mean average precision (MAP) of all the queries*/
>   lazy val meanAvePrec: Double
>   /*Returns the normalized discounted cumulative gain for each query */
>   lazy val ndcgAtK: RDD[Array[Double]]
>   /**
>    * @param k the position to compute the truncated ndcg
>    * @return the average ndcg at the first k ranking positions
>    */
>   def ndcg(k: Int): Double
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to