Class OriginalInverseEdgeMetricReranker<U>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalReranker<U,I>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker<U,I>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker<U,U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker<U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.edge.EdgeMetricReranker<U>
es.uam.eps.ir.relison.links.recommendation.reranking.global.local.edge.OriginalInverseEdgeMetricReranker<U>
- Type Parameters:
U- type of the users.
- All Implemented Interfaces:
GlobalReranker<U,U>
public class OriginalInverseEdgeMetricReranker<U> extends EdgeMetricReranker<U>
Reranker strategy that minimizes the average value of an edge metric.
It uses the value of the metric for the original network as the novelty value.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<U,java.util.Map<U,java.lang.Double>>valuesA map containing the edge metric values for each pair in the original graph.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.edge.EdgeMetricReranker
metricFields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker
graphFields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker
novMap, novStats, relStatsFields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker
cutOff -
Constructor Summary
Constructors Constructor Description OriginalInverseEdgeMetricReranker(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, PairMetric<U> metric)Constructor. -
Method Summary
Modifier and Type Method Description protected voidinnerUpdate(U user, org.ranksys.core.util.tuples.Tuple2od<U> bestItemValue)Updates the different parameters of the reranker, further than changing the edges in the graph.protected doublenov(U u, org.ranksys.core.util.tuples.Tuple2od<U> iv)Novelty score.protected voidupdate(es.uam.eps.ir.ranksys.core.Recommendation<U,U> reranked)Updates the values, given a new recommendation.protected voidupdate(U user, org.ranksys.core.util.tuples.Tuple2od<U> bestItemValue)Given a user, and the next value to add, updates the reranker parameters.Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker
rerankPermutation, selectItem, valueMethods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker
getBasePerm, rerankRecommendationMethods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalReranker
rerankRecommendations
-
Field Details
-
values
A map containing the edge metric values for each pair in the original graph.
-
-
Constructor Details
-
OriginalInverseEdgeMetricReranker
public OriginalInverseEdgeMetricReranker(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, PairMetric<U> metric)Constructor.- Parameters:
lambda- trade-off between the recommendation score and the novelty/diversity value.cutoff- number of elements to take.norm- the normalization strategy.graph- the original graph.metric- the metric we want to optimize.
-
-
Method Details
-
nov
Description copied from class:LocalLambdaRerankerNovelty score.- Specified by:
novin classLocalLambdaReranker<U,U>- Parameters:
u- the target user.iv- the recommended item and its recommendation score.- Returns:
- the novelty for this pair user-item.
-
update
Description copied from class:LocalGreedyRerankerGiven a user, and the next value to add, updates the reranker parameters.- Overrides:
updatein classGraphLocalReranker<U>- Parameters:
user- The userbestItemValue- The next value to add at the ranking
-
update
Description copied from class:LocalRerankerUpdates the values, given a new recommendation.- Specified by:
updatein classLocalReranker<U,U>- Parameters:
reranked- the reranked recommendation.
-
innerUpdate
Description copied from class:GraphLocalRerankerUpdates the different parameters of the reranker, further than changing the edges in the graph.- Specified by:
innerUpdatein classGraphLocalReranker<U>- Parameters:
user- the target user.bestItemValue- the new candidate user.
-