public interface Rescorer<T>
A Rescorer
simply assigns a new "score" to a thing like an ID of an item or user which a
Recommender
is considering returning as a top recommendation. It may be used to arbitrarily re-rank
the results according to application-specific logic before returning recommendations. For example, an
application may want to boost the score of items in a certain category just for one request.
A Rescorer
can also exclude a thing from consideration entirely by returning true
from
isFiltered(Object)
.
Modifier and Type | Method and Description |
---|---|
boolean |
isFiltered(T thing)
Returns
true to exclude the given thing. |
double |
rescore(T thing,
double originalScore) |
double rescore(T thing, double originalScore)
thing
- thing to rescoreoriginalScore
- original scoreDouble.NaN
to indicate that this should be excluded entirelyboolean isFiltered(T thing)
true
to exclude the given thing.thing
- the thing to filtertrue
to exclude, false
otherwiseCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.