Class RecommenderIndividualSampler<U>

java.lang.Object
es.uam.eps.ir.relison.links.data.letor.sampling.AbstractIndividualSampler<U>
es.uam.eps.ir.relison.links.data.letor.sampling.RecommenderIndividualSampler<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
IndividualSampler<U>

public class RecommenderIndividualSampler<U>
extends AbstractIndividualSampler<U>
Samples the top k of a contact recommendation algorithm.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int k
    The cutoff of the recommendation.
    private es.uam.eps.ir.ranksys.rec.Recommender<U,​U> rec
    The recommendation algorithm.

    Fields inherited from class es.uam.eps.ir.relison.links.data.letor.sampling.AbstractIndividualSampler

    graph
  • Constructor Summary

    Constructors 
    Constructor Description
    RecommenderIndividualSampler​(Graph<U> graph, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> rec, int k)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.Set<U> sampleUsers​(U u, java.util.function.Predicate<U> filter)
    Given a user, obtains the sample.

    Methods inherited from class java.lang.Object

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

    • rec

      private final es.uam.eps.ir.ranksys.rec.Recommender<U,​U> rec
      The recommendation algorithm.
    • k

      private final int k
      The cutoff of the recommendation.
  • Constructor Details

    • RecommenderIndividualSampler

      public RecommenderIndividualSampler​(Graph<U> graph, es.uam.eps.ir.ranksys.rec.Recommender<U,​U> rec, int k)
      Constructor.
      Parameters:
      graph - the graph.
      rec - a recommendation algorithm.
      k - the cutoff of the recommendation.
  • Method Details

    • sampleUsers

      public java.util.Set<U> sampleUsers​(U u, java.util.function.Predicate<U> filter)
      Description copied from interface: IndividualSampler
      Given a user, obtains the sample.
      Parameters:
      u - the parameter.
      filter - a filter for the sample
      Returns:
      the set of sampled users, with their relevance / weight.