Class UserFastRankingRecommender<U>

java.lang.Object
es.uam.eps.ir.ranksys.rec.AbstractRecommender<U,​I>
es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender<U,​I>
es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,​U>
es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender<U>
Type Parameters:
U - type of the users
All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<U>, es.uam.eps.ir.ranksys.core.index.UserIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>, es.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,​U>, es.uam.eps.ir.ranksys.rec.Recommender<U,​U>
Direct Known Subclasses:
AdamicAdar, BipartiteRecommender, BM25, CentroidCBRecommender, Closure, CommuteTime, Cosine, Dist2Popularity, HubDepressedIndex, HubPromotedIndex, Jaccard, LambdaMARTJForestsRecommender, LambdaMARTRecommender, LocalLHNIndex, MachineLearningRecommender, MachineLearningWekaRecommender, MatrixBasedRecommender, MostCommonNeighbors, NonReciprocalPreferentialAttachment, PageRank, PersonalizedPageRank, PivotedNormalizationVSM, Popularity, PreferentialAttachment, PropFlow, PurePersonalizedPageRank, QLD, QLJM, QLL, Random, ReciprocalLinks, ResourceAllocation, SALSA, ShortestDistance, Sorensen, TerrierRecommender, TotalNeighbors, TwitterRecommender, TwittomenderRecommender, UserFastRankingUpdateableRecommender, VSM

public abstract class UserFastRankingRecommender<U>
extends es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,​U>
Abstract class for user recommendation in social networks.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected FastGraph<U> graph
    The graph which represents the social network relations.

    Fields inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender

    iIndex, uIndex
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      UserFastRankingRecommender​(FastGraph<U> graph)
    Constructor.
    private UserFastRankingRecommender​(FastGraph<U> graph, GraphIndex<U> index)
    Private constructor.
  • Method Summary

    Modifier and Type Method Description
    protected double getFreq​(int uidx, int vidx, EdgeOrientation orient)
    Obtains the weight of an edge.
    protected double getFreq​(U u, U v, EdgeOrientation orient)
    Obtains the weight of an edge.
    FastGraph<U> getGraph()
    Obtains the graph.

    Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender

    getRecommendation, getScoresMap

    Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender

    getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, iidx2item, item2iidx, numItems, numUsers, uidx2user, user2uidx

    Methods inherited from class es.uam.eps.ir.ranksys.rec.AbstractRecommender

    getRecommendation, getRecommendation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex

    containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex

    containsUser, getAllUidx, getAllUsers, uidx2user, uidx2user, user2uidx, user2uidx

    Methods inherited from interface es.uam.eps.ir.ranksys.rec.Recommender

    getRecommendation, getRecommendation
  • Field Details

    • graph

      protected final FastGraph<U> graph
      The graph which represents the social network relations.
  • Constructor Details

    • UserFastRankingRecommender

      public UserFastRankingRecommender​(FastGraph<U> graph)
      Constructor.
      Parameters:
      graph - a fast graph representing the social network.
    • UserFastRankingRecommender

      private UserFastRankingRecommender​(FastGraph<U> graph, GraphIndex<U> index)
      Private constructor. Receives an index, in addition to a graph
      Parameters:
      graph - a fast graph representing the social network.
      index - the user index of the graph.
  • Method Details

    • getGraph

      public FastGraph<U> getGraph()
      Obtains the graph.
      Returns:
      the graph.
    • getFreq

      protected double getFreq​(U u, U v, EdgeOrientation orient)
      Obtains the weight of an edge.
      Parameters:
      u - the first node
      v - the second node
      orient - the orientation.
      Returns:
      the weight. In case of UND edge orientation, we take the sum of both possible weights (if the graph is weighted), or 1.0 if any of them exists (if the graph is unweighted).
    • getFreq

      protected double getFreq​(int uidx, int vidx, EdgeOrientation orient)
      Obtains the weight of an edge.
      Parameters:
      uidx - the first node identifier
      vidx - the second node identifier
      orient - the orientation.
      Returns:
      the weight. In case of UND edge orientation, we take the sum of both possible weights (if the graph is weighted), or 1.0 if any of them exists (if the graph is unweighted).