|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.search.score.AbstractAggregator it.unimi.di.mg4j.search.score.LinearAggregator
public class LinearAggregator
An aggregator that computes a linear combination of the component scorers.
This class requires, beside the usually array of scorers, a parallel array
of weights (not to be confused with
index weights
).
The score from each scorer will be multiplied by the respective weight, and the
overal score will be the sum of these values. Equalisation, if necessary, if performed
by maximising over the sample scores and dividing all scores by the resulting value.
Field Summary | |
---|---|
protected double[] |
equalisationFactor
The equalisation factors for each scorer (all set to one if no equalisation is required). |
protected double[] |
weight
The weights of each scorer. |
Fields inherited from class it.unimi.di.mg4j.search.score.AbstractAggregator |
---|
actualSamples, currSample, currScore, documentIterator, n, needsCaching, sampleDocument, samples, sampleScore, scorer |
Constructor Summary | |
---|---|
LinearAggregator(Scorer[] scorer,
double[] weight)
Creates a linear aggregator. |
Method Summary | |
---|---|
LinearAggregator |
copy()
|
protected double |
score(double[] score)
Computes an aggregated score using the given array of basic scores. |
protected void |
setupEqualizationFactors()
Sets up the equalisation factors. |
String |
toString()
|
Methods inherited from class it.unimi.di.mg4j.search.score.AbstractAggregator |
---|
equalize, getWeights, nextDocument, score, score, setWeights, usesIntervals, wrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final double[] weight
protected final double[] equalisationFactor
Constructor Detail |
---|
public LinearAggregator(Scorer[] scorer, double[] weight)
scorer
- the array of scorers.weight
- the array of weights.Method Detail |
---|
public LinearAggregator copy()
protected double score(double[] score)
AbstractAggregator
AbstractAggregator.scorer
.
score
in class AbstractAggregator
score
- an array of scores.
protected void setupEqualizationFactors()
AbstractAggregator
Implementations should look into AbstractAggregator.sampleScore
and set up the
equalisation logic. Note that this method is responsible for setting
up appropriate equalisation factors even if no equalisation is required
(e.g., setting all factors to 1 ).
setupEqualizationFactors
in class AbstractAggregator
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |