Class LinkPredictionSampler<U>

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

public class LinkPredictionSampler<U>
extends AbstractIndividualSampler<U>
Samples all the links created in a test graph, and the same amount of links which have not been created.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private Graph<U> testGraph
    The graph to check the positive / negative examples

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

    graph
  • Constructor Summary

    Constructors 
    Constructor Description
    LinkPredictionSampler​(Graph<U> graph, Graph<U> testGraph)
    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

    • testGraph

      private final Graph<U> testGraph
      The graph to check the positive / negative examples
  • Constructor Details

    • LinkPredictionSampler

      public LinkPredictionSampler​(Graph<U> graph, Graph<U> testGraph)
      Constructor.
      Parameters:
      graph - the graph.
      testGraph - the test graph containing the set of positive links.
  • 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.