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
Ordering
- Alphabetic
- By Inheritance
Inherited
- PrecisionAtK
- Serializable
- Product
- Equals
- Aggregator
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
andThenPresent[D](present2: (Double) ⇒ D): Aggregator[RankingPrediction[T], (Double, Long), D]
- Definition Classes
- Aggregator
-
def
append(l: (Double, Long), r: RankingPrediction[T]): (Double, Long)
- Definition Classes
- Aggregator
-
def
appendAll(old: (Double, Long), items: TraversableOnce[RankingPrediction[T]]): (Double, Long)
- Definition Classes
- Aggregator
-
def
apply(inputs: TraversableOnce[RankingPrediction[T]]): Double
- Definition Classes
- Aggregator
-
def
applyCumulatively[In <: TraversableOnce[RankingPrediction[T]], Out](inputs: In)(implicit bf: CanBuildFrom[In, Double, Out]): Out
- Definition Classes
- Aggregator
-
def
applyOption(inputs: TraversableOnce[RankingPrediction[T]]): Option[Double]
- Definition Classes
- Aggregator
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
composePrepare[A1](prepare2: (A1) ⇒ RankingPrediction[T]): Aggregator[A1, (Double, Long), Double]
- Definition Classes
- Aggregator
-
def
cumulativeIterator(inputs: Iterator[RankingPrediction[T]]): Iterator[Double]
- Definition Classes
- Aggregator
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
join[A2 <: RankingPrediction[T], B2, C2](that: Aggregator[A2, B2, C2]): Aggregator[A2, ((Double, Long), B2), (Double, C2)]
- Definition Classes
- Aggregator
- val k: Int
-
def
lift: MonoidAggregator[RankingPrediction[T], Option[(Double, Long)], Option[Double]]
- Definition Classes
- Aggregator
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
prepare(input: RankingPrediction[T]): (Double, Long)
- Definition Classes
- PrecisionAtK → Aggregator
-
def
present(score: (Double, Long)): Double
- Definition Classes
- PrecisionAtK → Aggregator
-
def
reduce(items: TraversableOnce[(Double, Long)]): (Double, Long)
- Definition Classes
- Aggregator
-
def
reduce(l: (Double, Long), r: (Double, Long)): (Double, Long)
- Definition Classes
- Aggregator
-
def
reduceOption(items: TraversableOnce[(Double, Long)]): Option[(Double, Long)]
- Definition Classes
- Aggregator
-
def
semigroup: Semigroup[(Double, Long)]
- Definition Classes
- PrecisionAtK → Aggregator
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toFold: Fold[RankingPrediction[T], Option[Double]]
- Definition Classes
- Aggregator
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
zip[A2, B2, C2](ag2: Aggregator[A2, B2, C2]): Aggregator[(RankingPrediction[T], A2), ((Double, Long), B2), (Double, C2)]
- Definition Classes
- Aggregator