Class RecommendationLinkPredictor<U>

java.lang.Object
es.uam.eps.ir.relison.links.linkprediction.AbstractLinkPredictor<U>
es.uam.eps.ir.relison.links.linkprediction.RecommendationLinkPredictor<U>
Type Parameters:
U - type of the users.
All Implemented Interfaces:
LinkPredictor<U>

public class RecommendationLinkPredictor<U>
extends AbstractLinkPredictor<U>
Link prediction algorithm based on a contact recommendation algorithm.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender
    The original contact recommendation algorithm.
  • Constructor Summary

    Constructors 
    Constructor Description
    RecommendationLinkPredictor​(Graph<U> graph, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender)
    Constructor.
    RecommendationLinkPredictor​(Graph<U> graph, java.util.Comparator<org.ranksys.core.util.tuples.Tuple2od<Pair<U>>> comparator, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    Prediction<U> getPrediction​(int maxLength, java.util.function.Predicate<Pair<U>> filter)
    Given a social network, ranks the possible user-user pairs, according to the scores given by the algorithm.

    Methods inherited from class es.uam.eps.ir.relison.links.linkprediction.AbstractLinkPredictor

    getComparator, getGraph, getPrediction, getPrediction, getPrediction, getPrediction, getPredictionScore

    Methods inherited from class java.lang.Object

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

    • recommender

      private final es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender
      The original contact recommendation algorithm.
  • Constructor Details

    • RecommendationLinkPredictor

      public RecommendationLinkPredictor​(Graph<U> graph, java.util.Comparator<org.ranksys.core.util.tuples.Tuple2od<Pair<U>>> comparator, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender)
      Constructor.
      Parameters:
      graph - the social network graph.
      comparator - the comparator for sorting the pairs.
      recommender - the original contact recommendation algorithm.
    • RecommendationLinkPredictor

      public RecommendationLinkPredictor​(Graph<U> graph, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> recommender)
      Constructor.
      Parameters:
      graph - the social network graph.
      recommender - the original contact recommendation algorithm.
  • Method Details

    • getPrediction

      public Prediction<U> getPrediction​(int maxLength, java.util.function.Predicate<Pair<U>> filter)
      Description copied from interface: LinkPredictor
      Given a social network, ranks the possible user-user pairs, according to the scores given by the algorithm. It only ranks those user pairs which pass a given filter. It returns a limited number of such pairs.
      Specified by:
      getPrediction in interface LinkPredictor<U>
      Specified by:
      getPrediction in class AbstractLinkPredictor<U>
      Parameters:
      maxLength - the maximum size of the link prediction list.
      filter - a filter to indicate which user pairs shall be ranked.
      Returns:
      a sorted list containing the user-user pairs and the link prediction score (in descending score order).