Class DistanceTwoLinkPredictionIndividualSampler<U>
java.lang.Object
es.uam.eps.ir.relison.links.data.letor.sampling.AbstractIndividualSampler<U>
es.uam.eps.ir.relison.links.data.letor.sampling.DistanceTwoLinkPredictionIndividualSampler<U>
- Type Parameters:
U- Type of the users.
- All Implemented Interfaces:
IndividualSampler<U>
public class DistanceTwoLinkPredictionIndividualSampler<U> extends AbstractIndividualSampler<U>
Samples all the links created at distance two from the user in a test graph,
and the same amount of links at distance two which have not been created.
-
Field Summary
Fields Modifier and Type Field Description private Graph<U>testGraphThe graph to check the positive / negative examplesprivate EdgeOrientationuSelEdge orientation for the neighbors of the origin node.private EdgeOrientationvSelEdge orientation for the neighbors of the destination nodes.Fields inherited from class es.uam.eps.ir.relison.links.data.letor.sampling.AbstractIndividualSampler
graph -
Constructor Summary
Constructors Constructor Description DistanceTwoLinkPredictionIndividualSampler(Graph<U> graph, Graph<U> testGraph, EdgeOrientation uSel, EdgeOrientation vSel)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.
-
Field Details
-
Constructor Details
-
DistanceTwoLinkPredictionIndividualSampler
public DistanceTwoLinkPredictionIndividualSampler(Graph<U> graph, Graph<U> testGraph, EdgeOrientation uSel, EdgeOrientation vSel)Constructor.- Parameters:
graph- the graph.testGraph- the test graph containing the set of positive links.uSel- edge orientation for the neighbors of the origin node.vSel- edge orientation for the neighbors of the selected nodes.
-
-
Method Details
-
sampleUsers
Description copied from interface:IndividualSamplerGiven 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.
-