Interface FastFiller<U,I>
- Type Parameters:
U
- Type of the users.I
- Type of the items.
- All Superinterfaces:
Filler<U,I>
- All Known Implementing Classes:
AbstractFastFiller
,IdFiller
,RandomFiller
public interface FastFiller<U,I> extends Filler<U,I>
Fast version of the filler interface.
-
Method Summary
Modifier and Type Method Description es.uam.eps.ir.ranksys.fast.FastRecommendation
fastFill(es.uam.eps.ir.ranksys.fast.FastRecommendation rec, int cutoff, java.util.function.Function<U,java.util.function.IntPredicate> pred)
Given a recommendation, fills it with until it reaches the desired number of items (if possible).java.util.stream.IntStream
fillerList(int uidx)
Returns a list with the identifiers of the items.
-
Method Details
-
fillerList
java.util.stream.IntStream fillerList(int uidx)Returns a list with the identifiers of the items.- Parameters:
uidx
- the identifier of the user.- Returns:
- a stream with the identifiers of the items used to fill lists for the user uidx
-
fastFill
es.uam.eps.ir.ranksys.fast.FastRecommendation fastFill(es.uam.eps.ir.ranksys.fast.FastRecommendation rec, int cutoff, java.util.function.Function<U,java.util.function.IntPredicate> pred)Given a recommendation, fills it with until it reaches the desired number of items (if possible). If the cutoff is greater than the indicated one, the recommendation is trimmed. Uses the index values of items.- Parameters:
rec
- the recommendation.cutoff
- the cutoff.pred
- a predicate for filtering the possible recommendations.- Returns:
- the new recommendation if everything is OK, null otherwise.
-