Interface Filler<U,​I>

Type Parameters:
U - Type of the users.
I - Type of the items.
All Known Subinterfaces:
FastFiller<U,​I>
All Known Implementing Classes:
AbstractFastFiller, IdFiller, RandomFiller

public interface Filler<U,​I>
Methods for classes that might be used to complete recommendation lists which do not fill themselves due to coverage problems of the algorithm.
  • Method Summary

    Modifier and Type Method Description
    es.uam.eps.ir.ranksys.core.Recommendation<U,​I> fill​(es.uam.eps.ir.ranksys.core.Recommendation<U,​I> rec, int cutoff, java.util.function.Function<U,​java.util.function.Predicate<I>> pred)
    Given a recommendation, fills it with until it reaches the desired number of items (if possible).
    java.util.stream.Stream<I> fillerList​(U u)
    Obtains the filler list for a given user.
    int numFilled()
    Number of elements filled.
    int numTotal()
    Number of total elements in the recommendation.
    void reset()
    Resets the filler.
  • Method Details

    • fillerList

      java.util.stream.Stream<I> fillerList​(U u)
      Obtains the filler list for a given user.
      Parameters:
      u - the user.
      Returns:
      a stream containing the filler list for the user.
    • fill

      es.uam.eps.ir.ranksys.core.Recommendation<U,​I> fill​(es.uam.eps.ir.ranksys.core.Recommendation<U,​I> rec, int cutoff, java.util.function.Function<U,​java.util.function.Predicate<I>> 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.
      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.
    • numFilled

      int numFilled()
      Number of elements filled.
      Returns:
      the number of elements filled in the last recommendation.
    • numTotal

      int numTotal()
      Number of total elements in the recommendation.
      Returns:
      the number of total elements in the recommendation.
    • reset

      void reset()
      Resets the filler.