Class InterCommunityDegreeGiniComplement<U>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalReranker<U,I>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker<U,I>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker<U,U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker<U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.communities.InterCommunityReranker<U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.communities.InterCommunityDegreeGiniComplement<U>
- Type Parameters:
U
- type of the users
- All Implemented Interfaces:
GlobalReranker<U,U>
public class InterCommunityDegreeGiniComplement<U> extends InterCommunityReranker<U>
Implementation of a reranking strategy for balancing the distribution of the degrees of the communities
in a community graph. It only considers links between communities.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Integer,java.lang.Integer>
degrees
The community degreesprotected EdgeOrientation
orientation
The orientation which indicates which community degree to useprotected double
sum
The total number of edges between communities.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.communities.InterCommunityReranker
communities, communityGraph
Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker
graph
Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker
novMap, novStats, relStats
Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker
cutOff
-
Constructor Summary
Constructors Constructor Description InterCommunityDegreeGiniComplement(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, Communities<U> communities, EdgeOrientation orientation)
Constructor. -
Method Summary
Modifier and Type Method Description protected void
innerUpdate(U user, org.ranksys.core.util.tuples.Tuple2od<U> iv)
Updates the different parameters of the reranker, further than changing the edges in the graph.protected double
nov(U u, org.ranksys.core.util.tuples.Tuple2od<U> iv)
Novelty score.protected void
update(es.uam.eps.ir.ranksys.core.Recommendation<U,U> reranked)
Updates the values, given a new recommendation.Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker
update
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker
rerankPermutation, selectItem, value
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker
getBasePerm, rerankRecommendation
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalReranker
rerankRecommendations
-
Field Details
-
orientation
The orientation which indicates which community degree to use -
degrees
protected java.util.Map<java.lang.Integer,java.lang.Integer> degreesThe community degrees -
sum
protected double sumThe total number of edges between communities.
-
-
Constructor Details
-
InterCommunityDegreeGiniComplement
public InterCommunityDegreeGiniComplement(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, Communities<U> communities, EdgeOrientation orientation)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.orientation
- the neighborhood selection for computing the degree.
-
-
Method Details
-
nov
Description copied from class:LocalLambdaReranker
Novelty score.- Specified by:
nov
in classLocalLambdaReranker<U,U>
- Parameters:
u
- the target user.iv
- the recommended item and its recommendation score.- Returns:
- the novelty for this pair user-item.
-
innerUpdate
Description copied from class:GraphLocalReranker
Updates the different parameters of the reranker, further than changing the edges in the graph.- Specified by:
innerUpdate
in classGraphLocalReranker<U>
- Parameters:
user
- the target user.iv
- the new candidate user.
-
update
Description copied from class:LocalReranker
Updates the values, given a new recommendation.- Specified by:
update
in classLocalReranker<U,U>
- Parameters:
reranked
- the reranked recommendation.
-