Class LinkPredictionMetricGridSelector<U,F>
java.lang.Object
es.uam.eps.ir.relison.grid.links.prediction.metrics.LinkPredictionMetricGridSelector<U,F>
- Type Parameters:
U- type of the users
public class LinkPredictionMetricGridSelector<U,F>
extends java.lang.Object
Class that translates from a grid to different link prediction metrics.
-
Constructor Summary
Constructors Constructor Description LinkPredictionMetricGridSelector()Constructor. -
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.String,LinkPredictionMetricFunction<U,F>>getMetrics(java.lang.String metric, Configurations configs)Given a list of parameter configurations, obtains the metrics.java.util.Map<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>>getMetrics(java.lang.String metric, Configurations configs, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a list of configurations, obtains a set of metrics.java.util.Map<java.lang.String,LinkPredictionMetricFunction<U,F>>getMetrics(java.lang.String metric, Grid grid)Given a grid of parameters, obtains the metric.java.util.Map<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>>getMetrics(java.lang.String metric, Grid grid, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a grid of parameters, obtains a set of configured metrics.Tuple2oo<java.lang.String,LinkPredictionMetricFunction<U,F>>getMetrics(java.lang.String metric, Parameters params)Obtains a single metric.Tuple2oo<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>>getMetrics(java.lang.String metric, Parameters params, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a set of parameters, obtains a single metric.LinkPredictionMetricConfigurator<U,F>selectGridSearch(java.lang.String algorithm)Selects a grid search given the name of an algorithm.
-
Constructor Details
-
LinkPredictionMetricGridSelector
public LinkPredictionMetricGridSelector()Constructor.
-
-
Method Details
-
getMetrics
public java.util.Map<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>> getMetrics(java.lang.String metric, Grid grid, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a grid of parameters, obtains a set of configured metrics.- Parameters:
metric- the name of the metric.grid- the parameter grid for the metric.trainGraph- the training network.testGraph- the test network.trainData- the training preference data.testData- the test preference data.featData- the feature data.comms- the communities for the users in the network.- Returns:
- the suppliers for the different metric variants, indexed by name.
-
getMetrics
public Tuple2oo<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>> getMetrics(java.lang.String metric, Parameters params, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a set of parameters, obtains a single metric.- Parameters:
metric- the name of the metric.params- the parameters of the metric.trainGraph- the training network.testGraph- the test network.trainData- the training preference data.testData- the test preference data.featData- the feature data.comms- the communities for the users in the network.- Returns:
- a map containing the suppliers of the algorithms, ordered by name.
-
getMetrics
public java.util.Map<java.lang.String,java.util.function.Supplier<LinkPredictionMetric<U>>> getMetrics(java.lang.String metric, Configurations configs, Graph<U> trainGraph, Graph<U> testGraph, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> trainData, es.uam.eps.ir.ranksys.core.preference.PreferenceData<U,U> testData, es.uam.eps.ir.ranksys.core.feature.FeatureData<U,F,java.lang.Double> featData, Communities<U> comms)Given a list of configurations, obtains a set of metrics.- Parameters:
metric- the name of the metric.configs- the different configurations for the metric.trainGraph- the training network.testGraph- the test network.trainData- the training preference data.testData- the test preference data.featData- the feature data.comms- the communities for the users in the network.- Returns:
- a map containing the suppliers of the algorithms, ordered by name.
-
getMetrics
public java.util.Map<java.lang.String,LinkPredictionMetricFunction<U,F>> getMetrics(java.lang.String metric, Grid grid)Given a grid of parameters, obtains the metric.- Parameters:
metric- the name of the metric.grid- the parameter grid for the metric.- Returns:
- functions for obtaining for the different metric variants given the graph and preference data, indexed by name.
-
getMetrics
public java.util.Map<java.lang.String,LinkPredictionMetricFunction<U,F>> getMetrics(java.lang.String metric, Configurations configs)Given a list of parameter configurations, obtains the metrics.- Parameters:
metric- the name of the metric.configs- configurations for the metric.- Returns:
- functions for obtaining for the different metric variants given the graph and preference data, indexed by name.
-
getMetrics
public Tuple2oo<java.lang.String,LinkPredictionMetricFunction<U,F>> getMetrics(java.lang.String metric, Parameters params)Obtains a single metric.- Parameters:
metric- the name of the metric.params- the parameters of the metric.- Returns:
- a tuple containing the name and a function for obtaining the metric.
-
selectGridSearch
Selects a grid search given the name of an algorithm.- Parameters:
algorithm- the name of the algorithm.- Returns:
- if the algorithm exists, returns its grid search, null otherwise.
-