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>
es.uam.eps.ir.relison.links.recommendation.algorithms.standalone.foaf.PreferentialAttachment<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>

public class PreferentialAttachment<U>
extends UserFastRankingRecommender<U>
Recommender based on the preferential attachment phenomena. It takes the product of the degrees of the target and candidate user, considering that the probability of creating a link is proportional to such product. When the selected neighbourhood is formed by the incoming nodes, then this method is equal to the Popularity recommender method.

Reference: M.E.J. Newman. Clustering and Preferential Attachment in Growing Networks. Physical Review Letters E, 64(025102) (2001).

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private boolean linkprediction
    Indicates if the mode is link prediction
    private EdgeOrientation uSel
    Link orientation for selecting the neighbours of the target node
    private EdgeOrientation vSel
    Link orientation for selecting the neighbours of the candidate node.

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender

    graph

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

    iIndex, uIndex
  • Constructor Summary

    Constructors 
    Constructor Description
    PreferentialAttachment​(FastGraph<U> graph, EdgeOrientation vSel)
    Constructor for recommendation mode.
    PreferentialAttachment​(FastGraph<U> graph, EdgeOrientation uSel, EdgeOrientation vSel)
    Constructor for link prediction mode.
  • Method Summary

    Modifier and Type Method Description
    it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)  

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender

    getFreq, getFreq, getGraph

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

    getRecommendation

    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

    • uSel

      private final EdgeOrientation uSel
      Link orientation for selecting the neighbours of the target node
    • vSel

      private final EdgeOrientation vSel
      Link orientation for selecting the neighbours of the candidate node.
    • linkprediction

      private final boolean linkprediction
      Indicates if the mode is link prediction
  • Constructor Details

    • PreferentialAttachment

      public PreferentialAttachment​(FastGraph<U> graph, EdgeOrientation vSel)
      Constructor for recommendation mode.
      Parameters:
      graph - training graph.
      vSel - link orientation for selecting the neighbours of the candidate node.
    • PreferentialAttachment

      public PreferentialAttachment​(FastGraph<U> graph, EdgeOrientation uSel, EdgeOrientation vSel)
      Constructor for link prediction mode.
      Parameters:
      graph - training graph.
      uSel - link orientation for selecting the neighbours of the target node.
      vSel - link orientation for selecting the neighbours of the candidate node.
  • Method Details

    • getScoresMap

      public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)
      Specified by:
      getScoresMap in class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,​U>