Class ModularityComplement<U>
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,U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.communities.CompleteCommunityReranker<U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.communities.ModularityComplement<U>
- Type Parameters:
U- type of the users.
- All Implemented Interfaces:
GlobalReranker<U,U>
public class ModularityComplement<U> extends CompleteCommunityReranker<U>
Implementation of a reranker which promotes the modularity complement of the network.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<U,java.lang.Integer>inDegreeThe relation between the users and their in-degree.protected longnumEdgesThe number of edges of the user graph.protected java.util.Map<U,java.lang.Integer>outDegreeThe relation between the users and their out-degree.protected doublesumK(G,C) = \sum_i,j |\Gamma_out(i)||\Gamma_in(j)|\delta(c_i, c_j)Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.communities.CompleteCommunityReranker
communities, communityGraph, graphFields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingLambdaReranker
lambda, novStats, recStatsFields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingGreedyReranker
cutOff -
Constructor Summary
Constructors Constructor Description ModularityComplement(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, Communities<U> communities)Constructor. -
Method Summary
Modifier and Type Method Description protected doublenov(U user, org.ranksys.core.util.tuples.Tuple2od<U> item)Finds the novelty score for a user-item pair.protected voidupdate(U user, org.ranksys.core.util.tuples.Tuple2od<U> selectedItem)Updates the value of the objective function after a selection.Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingLambdaReranker
score, selectRecommendationMethods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.globalranking.GlobalRankingGreedyReranker
rerankRecommendations
-
Field Details
-
Constructor Details
-
ModularityComplement
public ModularityComplement(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, Communities<U> communities)Constructor.- Parameters:
lambda- trade-off between the recommendation score and the novelty/diversity value.cutoff- number of elements to take.norm- the normalization strategy.graph- the original graph.communities- the relation between users and communities.
-
-
Method Details
-
nov
Description copied from class:GlobalRankingLambdaRerankerFinds the novelty score for a user-item pair.- Specified by:
novin classGlobalRankingLambdaReranker<U,U>- Parameters:
user- the target user.item- the candidate item (with its score).- Returns:
- the novelty value for the item.
-
update
Description copied from class:GlobalRankingGreedyRerankerUpdates the value of the objective function after a selection.- Specified by:
updatein classGlobalRankingGreedyReranker<U,U>- Parameters:
user- the selected user.selectedItem- the selected item and its score.
-