Class DistanceTwoLinkPredictionIndividualSamplerConfigurator<U>
java.lang.Object
es.uam.eps.ir.relison.grid.links.recommendation.sampling.DistanceTwoLinkPredictionIndividualSamplerConfigurator<U>
- Type Parameters:
U- type of the users.
- All Implemented Interfaces:
IndividualSamplingAlgorithmConfigurator<U>
public class DistanceTwoLinkPredictionIndividualSamplerConfigurator<U> extends java.lang.Object implements IndividualSamplingAlgorithmConfigurator<U>
Class for selecting nodes at distance 2 from the target user, considering the usual approach in link prediction,
i.e. we first take all the nodes at distance 2 from the target user in the training set. Then, we take all nodes in that
set with whom the target user has created a link in the test set, and we randomly select the same number of negative
examples.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DistanceTwoLinkPredictionIndividualSamplerConfigurator() -
Method Summary
Modifier and Type Method Description org.jooq.lambda.tuple.Tuple2<java.lang.String,IndividualSamplerFunction<U>>grid(Parameters params)Obtains a function for obtaining an individual sampling algorithm.org.jooq.lambda.tuple.Tuple2<java.lang.String,IndividualSampler<U>>grid(Parameters params, FastGraph<U> trainGraph, FastGraph<U> testGraph, es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,U> prefData)Obtains an individual sampling algorithm.
-
Field Details
-
USEL
private static final java.lang.String USELIdentifier of the neighbor orientation for the sampled user.- See Also:
- Constant Field Values
-
VSEL
private static final java.lang.String VSELIdentifier of the neighbor orientation for the objective users.- See Also:
- Constant Field Values
-
-
Constructor Details
-
DistanceTwoLinkPredictionIndividualSamplerConfigurator
public DistanceTwoLinkPredictionIndividualSamplerConfigurator()
-
-
Method Details
-
grid
public org.jooq.lambda.tuple.Tuple2<java.lang.String,IndividualSampler<U>> grid(Parameters params, FastGraph<U> trainGraph, FastGraph<U> testGraph, es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,U> prefData)Description copied from interface:IndividualSamplingAlgorithmConfiguratorObtains an individual sampling algorithm.- Specified by:
gridin interfaceIndividualSamplingAlgorithmConfigurator<U>- Parameters:
params- the parameter selection for the approach.trainGraph- the original graph.testGraph- a test graph to consider when sampling.prefData- the training preference data.- Returns:
- a pair containing the name of the algorithm and the configured algorithm.
-
grid
public org.jooq.lambda.tuple.Tuple2<java.lang.String,IndividualSamplerFunction<U>> grid(Parameters params)Description copied from interface:IndividualSamplingAlgorithmConfiguratorObtains a function for obtaining an individual sampling algorithm.- Specified by:
gridin interfaceIndividualSamplingAlgorithmConfigurator<U>- Parameters:
params- the sampling parameters.- Returns:
- a pair containing the name of the algorithm and a function for obtaining the configured algorithm.
-