Class WeakTies.ModularityUserReranker

Enclosing class:
WeakTies<U>

protected class WeakTies.ModularityUserReranker
extends InterCommunityReranker.CommunityMetricUserReranker
Class that reranks an individual recommendation using modularity.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Map<U,​java.lang.Integer> inDegree
    The relation between the users and their in-degree.
    protected long numEdges
    The number of edges of the user graph.
    protected java.util.Map<U,​java.lang.Integer> outDegree
    The relation between the users and their out-degree.
    protected double sum
    K(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.local.communities.InterCommunityReranker.CommunityMetricUserReranker

    communities, communityGraph

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.local.LambdaReranker.LambdaUserReranker

    novMap, novStats, relStats
  • Constructor Summary

    Constructors 
    Constructor Description
    ModularityUserReranker​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> recommendation, int maxLength, Graph<U> graph, MultiGraph<java.lang.Integer> communityGraph, Communities<U> communities)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    protected double nov​(org.ranksys.core.util.tuples.Tuple2od<U> tpld)
    Returns the novelty score of an item.
    protected void update​(org.ranksys.core.util.tuples.Tuple2od<U> tpld)  

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.local.LambdaReranker.LambdaUserReranker

    selectItem, value

    Methods inherited from class java.lang.Object

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

    • numEdges

      protected long numEdges
      The number of edges of the user graph.
    • inDegree

      protected java.util.Map<U,​java.lang.Integer> inDegree
      The relation between the users and their in-degree.
    • outDegree

      protected java.util.Map<U,​java.lang.Integer> outDegree
      The relation between the users and their out-degree.
    • sum

      protected double sum
      K(G,C) = \sum_i,j |\Gamma_out(i)||\Gamma_in(j)|\delta(c_i, c_j)
  • Constructor Details

    • ModularityUserReranker

      public ModularityUserReranker​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> recommendation, int maxLength, Graph<U> graph, MultiGraph<java.lang.Integer> communityGraph, Communities<U> communities)
      Constructor.
      Parameters:
      recommendation - the recommendations for the user.
      maxLength - the maximum number of items to recommend.
      graph - the user graph.
      communityGraph - the community graph.
      communities - the relation between users and communities.
  • Method Details

    • nov

      protected double nov​(org.ranksys.core.util.tuples.Tuple2od<U> tpld)
      Description copied from class: LambdaReranker.LambdaUserReranker
      Returns the novelty score of an item.
      Specified by:
      nov in class LambdaReranker.LambdaUserReranker
      Parameters:
      tpld - item-relevance pair
      Returns:
      the novelty of the item
    • update

      protected void update​(org.ranksys.core.util.tuples.Tuple2od<U> tpld)