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 usersI- 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 doublelambdaTrade-off between the original and the novelty scores.private java.util.function.Supplier<Normalizer<I>>normSupplier for the normalization strategy.private java.util.Map<U,java.util.Map<I,java.lang.Double>>novMapFor each pair user-item, their associated noveltyprotected Normalizer<I>novStatsStatistics for the novelty scoresprotected Normalizer<I>recStatsStatistics 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 doublenov(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)Finds the novelty score for a user-item pair.protected doublescore(U user, org.ranksys.core.util.tuples.Tuple2od<I> item)Computes the score of a recommendation itemprotected 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
-
Field Details
-
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:GlobalRankingGreedyRerankerSelects the next recommendation to add to the reranked one.- Overrides:
selectRecommendationin classGlobalRankingGreedyReranker<U,I>- Parameters:
remainingItems- the remaining items.- Returns:
- a tuple containing the recommendation to add.
-
score
Description copied from class:GlobalRankingGreedyRerankerComputes the score of a recommendation item- Specified by:
scorein classGlobalRankingGreedyReranker<U,I>- Parameters:
user- the useritem- the original value.- Returns:
- the new score.
-
nov
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.
-