java.lang.Object
es.uam.eps.ir.relison.links.recommendation.reranking.normalizer.RanksimNormalizer<I>
Type Parameters:
I - type of the items.
All Implemented Interfaces:
Normalizer<I>

public class RanksimNormalizer<I>
extends java.lang.Object
implements Normalizer<I>
Ranksim normalizer. It considers the positions in the ranking to provide normalization of the scores.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.Comparator<org.ranksys.core.util.tuples.Tuple2od<I>> comp
    Comparator for sorting the tuples in the tree set.
    private boolean isSorted
    True if the map linking items with its ranking has been generated.
    private it.unimi.dsi.fastutil.objects.Object2IntMap<I> map
    A mapping between item id and ranking position.
    private java.util.TreeSet<org.ranksys.core.util.tuples.Tuple2od<I>> ranking
    The actual ranking.
  • Constructor Summary

    Constructors 
    Constructor Description
    RanksimNormalizer()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void add​(I i, double val)
    Adds an item-value pair to the list.
    double norm​(I i, double value)
    Given an item-value pair, it computes the normalized value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface es.uam.eps.ir.relison.links.recommendation.reranking.normalizer.Normalizer

    add, norm
  • Field Details

    • isSorted

      private boolean isSorted
      True if the map linking items with its ranking has been generated.
    • ranking

      private final java.util.TreeSet<org.ranksys.core.util.tuples.Tuple2od<I>> ranking
      The actual ranking.
    • map

      private final it.unimi.dsi.fastutil.objects.Object2IntMap<I> map
      A mapping between item id and ranking position.
    • comp

      private java.util.Comparator<org.ranksys.core.util.tuples.Tuple2od<I>> comp
      Comparator for sorting the tuples in the tree set.
  • Constructor Details

  • Method Details

    • add

      public void add​(I i, double val)
      Description copied from interface: Normalizer
      Adds an item-value pair to the list.
      Specified by:
      add in interface Normalizer<I>
      Parameters:
      i - the item identifier.
      val - the value of the item.
    • norm

      public double norm​(I i, double value)
      Description copied from interface: Normalizer
      Given an item-value pair, it computes the normalized value.
      Specified by:
      norm in interface Normalizer<I>
      Parameters:
      i - the item identifier.
      value - the value.
      Returns:
      the normalized value.