c

com.spotify.noether

PrecisionAtK

case class PrecisionAtK[T](k: Int) extends Aggregator[RankingPrediction[T], (Double, Long), Double] with Product with Serializable

Compute the average precision of all the predictions, truncated at ranking position k.

If for a prediction, the ranking algorithm returns n (n is less than k) results, the precision value will be computed as #(relevant items retrieved) / k. This formula also applies when the size of the ground truth set is less than k.

If a prediction has an empty ground truth set, zero will be used as precision together

See the following paper for detail:

IR evaluation methods for retrieving highly relevant documents. K. Jarvelin and J. Kekalainen

k

the position to compute the truncated precision, must be positive

Linear Supertypes
Serializable, Product, Equals, Aggregator[RankingPrediction[T], (Double, Long), Double], Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PrecisionAtK
  2. Serializable
  3. Product
  4. Equals
  5. Aggregator
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PrecisionAtK(k: Int)

    k

    the position to compute the truncated precision, must be positive

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThenPresent[D](present2: (Double) ⇒ D): Aggregator[RankingPrediction[T], (Double, Long), D]
    Definition Classes
    Aggregator
  5. def append(l: (Double, Long), r: RankingPrediction[T]): (Double, Long)
    Definition Classes
    Aggregator
  6. def appendAll(old: (Double, Long), items: TraversableOnce[RankingPrediction[T]]): (Double, Long)
    Definition Classes
    Aggregator
  7. def apply(inputs: TraversableOnce[RankingPrediction[T]]): Double
    Definition Classes
    Aggregator
  8. def applyCumulatively[In <: TraversableOnce[RankingPrediction[T]], Out](inputs: In)(implicit bf: CanBuildFrom[In, Double, Out]): Out
    Definition Classes
    Aggregator
  9. def applyOption(inputs: TraversableOnce[RankingPrediction[T]]): Option[Double]
    Definition Classes
    Aggregator
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  12. def composePrepare[A1](prepare2: (A1) ⇒ RankingPrediction[T]): Aggregator[A1, (Double, Long), Double]
    Definition Classes
    Aggregator
  13. def cumulativeIterator(inputs: Iterator[RankingPrediction[T]]): Iterator[Double]
    Definition Classes
    Aggregator
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def join[A2 <: RankingPrediction[T], B2, C2](that: Aggregator[A2, B2, C2]): Aggregator[A2, ((Double, Long), B2), (Double, C2)]
    Definition Classes
    Aggregator
  19. val k: Int
  20. def lift: MonoidAggregator[RankingPrediction[T], Option[(Double, Long)], Option[Double]]
    Definition Classes
    Aggregator
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def prepare(input: RankingPrediction[T]): (Double, Long)
    Definition Classes
    PrecisionAtK → Aggregator
  25. def present(score: (Double, Long)): Double
    Definition Classes
    PrecisionAtK → Aggregator
  26. def reduce(items: TraversableOnce[(Double, Long)]): (Double, Long)
    Definition Classes
    Aggregator
  27. def reduce(l: (Double, Long), r: (Double, Long)): (Double, Long)
    Definition Classes
    Aggregator
  28. def reduceOption(items: TraversableOnce[(Double, Long)]): Option[(Double, Long)]
    Definition Classes
    Aggregator
  29. def semigroup: Semigroup[(Double, Long)]
    Definition Classes
    PrecisionAtK → Aggregator
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def toFold: Fold[RankingPrediction[T], Option[Double]]
    Definition Classes
    Aggregator
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. def zip[A2, B2, C2](ag2: Aggregator[A2, B2, C2]): Aggregator[(RankingPrediction[T], A2), ((Double, Long), B2), (Double, C2)]
    Definition Classes
    Aggregator

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Aggregator[RankingPrediction[T], (Double, Long), Double]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped