Class GlobalRankingLambdaReranker<U,​I>

java.lang.Object
es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingGreedyReranker<U,​I>
es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingLambdaReranker<U,​I>
Type Parameters:
U - type of the users
I - type of the items
All Implemented Interfaces:
GlobalReranker<U,​I>
Direct Known Subclasses:
ClusteringCoefficientComplement, CompleteCommunityReranker, EdgeMetricReranker, GraphMetricReranker, InterCommunityReranker, UserMetricReranker

public abstract class GlobalRankingLambdaReranker<U,​I>
extends GlobalRankingGreedyReranker<U,​I>
Implementation of a greedy reranking strategy for optimizing global properties of the system. This reranker chooses the items which have a more significant impact on the global property to optimize. Given a set of recommendations for different users, these rerankers iteratively choose the user-item pair that maximizes a given objective function. The objective function jointly maximizes the accuracy of the system and the novelty/diversity of the system (it takes a trade-off between them).
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected double lambda
    Trade-off between the original and the novelty scores.
    private java.util.function.Supplier<Normalizer<I>> norm
    Supplier for the normalization strategy.
    private java.util.Map<U,​java.util.Map<I,​java.lang.Double>> novMap
    For each pair user-item, their associated novelty
    protected Normalizer<I> novStats
    Statistics for the novelty scores
    protected Normalizer<I> recStats
    Statistics for the original scores.

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingGreedyReranker

    cutOff
  • Constructor Summary

    Constructors 
    Constructor Description
    GlobalRankingLambdaReranker​(double lambda, int cutOff, java.util.function.Supplier<Normalizer<I>> norm)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    protected abstract double nov​(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)
    Finds the novelty score for a user-item pair.
    protected double score​(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)
    Computes the score of a recommendation item
    protected Tuple2oo<U,​org.ranksys.core.util.tuples.Tuple2id> selectRecommendation​(java.util.Map<U,​java.util.List<org.ranksys.core.util.tuples.Tuple2od<I>>> remainingItems)
    Selects the next recommendation to add to the reranked one.

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingGreedyReranker

    rerankRecommendations, update

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lambda

      protected final double lambda
      Trade-off between the original and the novelty scores.
    • recStats

      protected Normalizer<I> recStats
      Statistics for the original scores.
    • novStats

      protected Normalizer<I> novStats
      Statistics for the novelty scores
    • novMap

      private java.util.Map<U,​java.util.Map<I,​java.lang.Double>> novMap
      For each pair user-item, their associated novelty
    • norm

      private final java.util.function.Supplier<Normalizer<I>> norm
      Supplier for the normalization strategy.
  • Constructor Details

    • GlobalRankingLambdaReranker

      public GlobalRankingLambdaReranker​(double lambda, int cutOff, java.util.function.Supplier<Normalizer<I>> norm)
      Constructor.
      Parameters:
      lambda - trade-off between the original and the novelty scores.
      cutOff - maximum size of the definitive ranking.
      norm - the normalization strategy.
  • Method Details

    • selectRecommendation

      protected Tuple2oo<U,​org.ranksys.core.util.tuples.Tuple2id> selectRecommendation​(java.util.Map<U,​java.util.List<org.ranksys.core.util.tuples.Tuple2od<I>>> remainingItems)
      Description copied from class: GlobalRankingGreedyReranker
      Selects the next recommendation to add to the reranked one.
      Overrides:
      selectRecommendation in class GlobalRankingGreedyReranker<U,​I>
      Parameters:
      remainingItems - the remaining items.
      Returns:
      a tuple containing the recommendation to add.
    • score

      protected double score​(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)
      Description copied from class: GlobalRankingGreedyReranker
      Computes the score of a recommendation item
      Specified by:
      score in class GlobalRankingGreedyReranker<U,​I>
      Parameters:
      user - the user
      item - the original value.
      Returns:
      the new score.
    • nov

      protected abstract double nov​(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)
      Finds the novelty score for a user-item pair.
      Parameters:
      user - the target user.
      item - the candidate item (with its score).
      Returns:
      the novelty value for the item.