org.elasticsearch.common.io.stream.NamedWriteable, org.elasticsearch.common.io.stream.Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, EvaluationMetricpublic class MeanReciprocalRank extends java.lang.Object implements EvaluationMetric
| Modifier and Type | Class | Description |
|---|---|---|
static class |
MeanReciprocalRank.Detail |
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
NAME |
| Constructor | Description |
|---|---|
MeanReciprocalRank() |
|
MeanReciprocalRank(int relevantRatingThreshold,
int k) |
Metric implementing Mean Reciprocal Rank (https://en.wikipedia.org/wiki/Mean_reciprocal_rank).
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object obj) |
|
EvalQueryQuality |
evaluate(java.lang.String taskId,
org.elasticsearch.search.SearchHit[] hits,
java.util.List<RatedDocument> ratedDocs) |
Compute ReciprocalRank based on provided relevant document IDs.
|
java.util.Optional<java.lang.Integer> |
forcedSearchSize() |
Metrics can define a size of the search hits windows they want to retrieve by overwriting
this method.
|
static MeanReciprocalRank |
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) |
|
int |
getRelevantRatingThreshold() |
Return the rating threshold above which ratings are considered to be "relevant".
|
java.lang.String |
getWriteableName() |
|
int |
hashCode() |
|
org.elasticsearch.common.xcontent.XContentBuilder |
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder,
org.elasticsearch.common.xcontent.ToXContent.Params params) |
|
void |
writeTo(org.elasticsearch.common.io.stream.StreamOutput out) |
combinepublic static final java.lang.String NAME
public MeanReciprocalRank()
public MeanReciprocalRank(int relevantRatingThreshold,
int k)
relevantRatingThreshold - the rating value that a document needs to be regarded as "relevant". Defaults to 1.k - the search window size all request use.public void writeTo(org.elasticsearch.common.io.stream.StreamOutput out)
throws java.io.IOException
writeTo in interface org.elasticsearch.common.io.stream.Writeablejava.io.IOExceptionpublic java.util.Optional<java.lang.Integer> forcedSearchSize()
EvaluationMetricforcedSearchSize in interface EvaluationMetricpublic java.lang.String getWriteableName()
getWriteableName in interface org.elasticsearch.common.io.stream.NamedWriteablepublic int getRelevantRatingThreshold()
public EvalQueryQuality evaluate(java.lang.String taskId, org.elasticsearch.search.SearchHit[] hits, java.util.List<RatedDocument> ratedDocs)
evaluate in interface EvaluationMetrictaskId - the id of the query for which the ranking is currently evaluatedhits - the result hits as returned by a search requestratedDocs - the documents that were ranked by human annotators for this query
casepublic static MeanReciprocalRank fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder,
org.elasticsearch.common.xcontent.ToXContent.Params params)
throws java.io.IOException
toXContent in interface org.elasticsearch.common.xcontent.ToXContentjava.io.IOExceptionpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Object