Class OriginalDirectUserMetricReranker<U>

Type Parameters:
U - type of the users
All Implemented Interfaces:
GlobalReranker<U,​U>

public class OriginalDirectUserMetricReranker<U>
extends UserMetricReranker<U>
Reranker that optimizes the average value of vertex metric. The value of the metric in the original graph is taken as the novelty score.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.Map<U,​java.lang.Double> values
    Metric values for each node in the graph

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.user.UserMetricReranker

    metric

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.GraphLocalReranker

    graph

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalLambdaReranker

    novMap, novStats, relStats

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker

    cutOff
  • Constructor Summary

    Constructors 
    Constructor Description
    OriginalDirectUserMetricReranker​(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, VertexMetric<U> metric)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    protected void innerUpdate​(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 double nov​(U u, org.ranksys.core.util.tuples.Tuple2od<U> iv)
    Novelty score.
    protected void update​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> reranked)
    Updates the values, given a new recommendation.
    protected void update​(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, value

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalGreedyReranker

    getBasePerm, rerankRecommendation

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.reranking.global.local.LocalReranker

    rerankRecommendations

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • values

      private final java.util.Map<U,​java.lang.Double> values
      Metric values for each node in the graph
  • Constructor Details

    • OriginalDirectUserMetricReranker

      public OriginalDirectUserMetricReranker​(double lambda, int cutoff, java.util.function.Supplier<Normalizer<U>> norm, Graph<U> graph, VertexMetric<U> metric)
      Constructor.
      Parameters:
      lambda - trade-off between the original and novelty scores
      cutoff - maximum length of the definitive ranking.
      norm - the normalization strategy.
      graph - the original graph.
      metric - the vertex metric to optimize.
  • Method Details

    • nov

      protected double nov​(U u, org.ranksys.core.util.tuples.Tuple2od<U> iv)
      Description copied from class: LocalLambdaReranker
      Novelty score.
      Specified by:
      nov in class LocalLambdaReranker<U,​U>
      Parameters:
      u - the target user.
      iv - the recommended item and its recommendation score.
      Returns:
      the novelty for this pair user-item.
    • innerUpdate

      protected void innerUpdate​(U user, org.ranksys.core.util.tuples.Tuple2od<U> bestItemValue)
      Description copied from class: GraphLocalReranker
      Updates the different parameters of the reranker, further than changing the edges in the graph.
      Specified by:
      innerUpdate in class GraphLocalReranker<U>
      Parameters:
      user - the target user.
      bestItemValue - the new candidate user.
    • update

      protected void update​(U user, org.ranksys.core.util.tuples.Tuple2od<U> bestItemValue)
      Description copied from class: LocalGreedyReranker
      Given a user, and the next value to add, updates the reranker parameters.
      Overrides:
      update in class GraphLocalReranker<U>
      Parameters:
      user - The user
      bestItemValue - The next value to add at the ranking
    • update

      protected void update​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> reranked)
      Description copied from class: LocalReranker
      Updates the values, given a new recommendation.
      Specified by:
      update in class LocalReranker<U,​U>
      Parameters:
      reranked - the reranked recommendation.