java.lang.Object
es.uam.eps.ir.ranksys.rec.AbstractRecommender<U,​I>
Type Parameters:
U - type of the users.
All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<U>, es.uam.eps.ir.ranksys.core.index.UserIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastItemIndex<U>, es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>, es.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,​U>, es.uam.eps.ir.ranksys.rec.Recommender<U,​U>, FastUpdateableRecommender<U,​U>, UpdateableRecommender<U,​U>

public class UpdateableUBkNN<U>
extends FastUpdateableRankingRecommender<U,​U>
Updateable version of the user-based nearest-neighbors approach.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int k
    The number of neighbors to select.
    private UpdateableGraphSimilarity sim
    Updateable similarity between pairs of users.

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.updateable.fast.AbstractFastUpdateableRecommender

    prefData
  • Constructor Summary

    Constructors 
    Constructor Description
    UpdateableUBkNN​(FastUpdateablePreferenceData<U,​U> prefData, UpdateableGraphSimilarity similarity, int k)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)
    Returns a map of item-score pairs.
    void update​(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,​U,​java.lang.Double>> tuples)
    Updates the values of the recommender, considering that the following preferences have been added.
    void update​(U u, U v, double val)
    Updates the values of the recommender, considering that a new rating has been added.
    void updateAddItem​(U u)
    Updates the values of the recommender, considering that a new item has been added.
    void updateAddUser​(U u)
    Updates the values of the recommender, considering that a new user has been added.
    void updateDelete​(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,​U,​java.lang.Double>> tuples)
    Updates the values of the recommender, considering that the following preferences have been removed.
    void updateDelete​(U u, U u2, double val)
    Updates the values of the recommender, considering that a rating has been deleted.

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.updateable.fast.FastUpdateableRankingRecommender

    getRecommendation

    Methods inherited from class es.uam.eps.ir.ranksys.rec.AbstractRecommender

    getRecommendation, getRecommendation

    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.ranksys.fast.index.FastItemIndex

    containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx

    Methods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastUserIndex

    containsUser, getAllUidx, getAllUsers, uidx2user, uidx2user, user2uidx, user2uidx

    Methods inherited from interface es.uam.eps.ir.ranksys.rec.Recommender

    getRecommendation, getRecommendation
  • Field Details

    • sim

      private final UpdateableGraphSimilarity sim
      Updateable similarity between pairs of users.
    • k

      private final int k
      The number of neighbors to select.
  • Constructor Details

  • Method Details

    • getScoresMap

      public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap​(int uidx)
      Description copied from class: FastUpdateableRankingRecommender
      Returns a map of item-score pairs.
      Specified by:
      getScoresMap in class FastUpdateableRankingRecommender<U,​U>
      Parameters:
      uidx - index of the user whose scores are predicted
      Returns:
      a map of item-score pairs
    • update

      public void update​(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,​U,​java.lang.Double>> tuples)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that the following preferences have been added.
      Parameters:
      tuples - the preferences which have been added.
    • updateDelete

      public void updateDelete​(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,​U,​java.lang.Double>> tuples)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that the following preferences have been removed.
      Parameters:
      tuples - the preferences which have been removed.
    • updateAddUser

      public void updateAddUser​(U u)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that a new user has been added.
      Parameters:
      u - the user which has been added.
    • updateAddItem

      public void updateAddItem​(U u)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that a new item has been added.
      Parameters:
      u - the item which has been added.
    • update

      public void update​(U u, U v, double val)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that a new rating has been added.
      Parameters:
      u - the user.
      v - the item
      val - the value.
    • updateDelete

      public void updateDelete​(U u, U u2, double val)
      Description copied from interface: UpdateableRecommender
      Updates the values of the recommender, considering that a rating has been deleted.
      Parameters:
      u - the user.
      u2 - the item.
      val - the value.