org.elasticsearch.common.io.stream.NamedWriteable, org.elasticsearch.common.io.stream.Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, EvaluationMetricpublic class DiscountedCumulativeGain extends java.lang.Object implements EvaluationMetric
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
NAME |
| Constructor | Description |
|---|---|
DiscountedCumulativeGain() |
|
DiscountedCumulativeGain(boolean normalize,
java.lang.Integer unknownDocRating,
int k) |
| 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) |
Returns a single metric representing the ranking quality of a set of returned
documents wrt.
|
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 DiscountedCumulativeGain |
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) |
|
java.lang.Integer |
getUnknownDocRating() |
get the rating used for unrated documents
|
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 DiscountedCumulativeGain()
public DiscountedCumulativeGain(boolean normalize,
java.lang.Integer unknownDocRating,
int k)
normalize - If set to true, dcg will be normalized (ndcg) See
https://en.wikipedia.org/wiki/Discounted_cumulative_gainunknownDocRating - the rating for documents the user hasn't supplied an explicit
rating fork - 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.lang.String getWriteableName()
getWriteableName in interface org.elasticsearch.common.io.stream.NamedWriteablepublic java.lang.Integer getUnknownDocRating()
public java.util.Optional<java.lang.Integer> forcedSearchSize()
EvaluationMetricforcedSearchSize in interface EvaluationMetricpublic EvalQueryQuality evaluate(java.lang.String taskId, org.elasticsearch.search.SearchHit[] hits, java.util.List<RatedDocument> ratedDocs)
EvaluationMetricevaluate 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 DiscountedCumulativeGain 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