Class MFUpdateableRecommender<U,I>
java.lang.Object
es.uam.eps.ir.ranksys.rec.AbstractRecommender<U,I>
es.uam.eps.ir.relison.links.recommendation.updateable.fast.AbstractFastUpdateableRecommender<U,I>
es.uam.eps.ir.relison.links.recommendation.updateable.mf.MFUpdateableRecommender<U,I>
- Type Parameters:
U- type of the usersI- type of the items
- All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.index.ItemIndex<I>,es.uam.eps.ir.ranksys.core.index.UserIndex<U>,es.uam.eps.ir.ranksys.fast.index.FastItemIndex<I>,es.uam.eps.ir.ranksys.fast.index.FastUserIndex<U>,es.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,I>,es.uam.eps.ir.ranksys.rec.Recommender<U,I>,FastUpdateableRecommender<U,I>,UpdateableRecommender<U,I>
public class MFUpdateableRecommender<U,I> extends AbstractFastUpdateableRecommender<U,I>
Matrix factorization recommender. Scores are calculated as the inner product of user and item vectors.
The recommendation algorithm can be updated over time.
-
Field Summary
Fields Modifier and Type Field Description private UpdateableFactorization<U,I>factorizationThe current matrix factorization.private UpdateableFactorizer<U,I>factorizerThe factorizer.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.updateable.fast.AbstractFastUpdateableRecommender
prefData -
Constructor Summary
Constructors Constructor Description MFUpdateableRecommender(FastUpdateablePreferenceData<U,I> dataPref, UpdateableFactorization<U,I> factorization, UpdateableFactorizer<U,I> factorizer)Constructor. -
Method Summary
Modifier and Type Method Description es.uam.eps.ir.ranksys.fast.FastRecommendationgetRecommendation(int uidx, int maxLength, java.util.function.IntPredicate filter)es.uam.eps.ir.ranksys.fast.FastRecommendationgetRecommendation(int uidx, java.util.stream.IntStream candidates)voidupdate(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)Updates the values of the recommender, considering that the following preferences have been added.voidupdate(U u, I i, double val)Updates the values of the recommender, considering that a new rating has been added.voidupdateAddItem(I i)Updates the values of the recommender, considering that a new item has been added.voidupdateAddUser(U u)Updates the values of the recommender, considering that a new user has been added.voidupdateDelete(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)Updates the values of the recommender, considering that the following preferences have been removed.voidupdateDelete(U u, I i, 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.AbstractFastUpdateableRecommender
getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, getRecommendation, iidx2item, item2iidx, numItems, numUsers, uidx2user, user2uidxMethods inherited from class es.uam.eps.ir.ranksys.rec.AbstractRecommender
getRecommendation, getRecommendationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.ranksys.fast.index.FastItemIndex
containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx
-
Field Details
-
factorization
The current matrix factorization. -
factorizer
The factorizer.
-
-
Constructor Details
-
MFUpdateableRecommender
public MFUpdateableRecommender(FastUpdateablePreferenceData<U,I> dataPref, UpdateableFactorization<U,I> factorization, UpdateableFactorizer<U,I> factorizer)Constructor.- Parameters:
dataPref- preferencesfactorization- matrix factorizationfactorizer- the factorizer.
-
-
Method Details
-
getRecommendation
public es.uam.eps.ir.ranksys.fast.FastRecommendation getRecommendation(int uidx, int maxLength, java.util.function.IntPredicate filter)- Specified by:
getRecommendationin interfacees.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,I>- Specified by:
getRecommendationin classAbstractFastUpdateableRecommender<U,I>
-
getRecommendation
public es.uam.eps.ir.ranksys.fast.FastRecommendation getRecommendation(int uidx, java.util.stream.IntStream candidates)- Specified by:
getRecommendationin interfacees.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,I>- Overrides:
getRecommendationin classAbstractFastUpdateableRecommender<U,I>
-
updateAddUser
Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that a new user has been added.- Parameters:
u- the user which has been added.
-
updateAddItem
Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that a new item has been added.- Parameters:
i- the item which has been added.
-
update
public void update(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that the following preferences have been added.- Parameters:
tuples- the preferences which have been added.
-
update
Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that a new rating has been added.- Parameters:
u- the user.i- the itemval- the value.
-
updateDelete
public void updateDelete(java.util.stream.Stream<org.jooq.lambda.tuple.Tuple3<U,I,java.lang.Double>> tuples)Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that the following preferences have been removed.- Parameters:
tuples- the preferences which have been removed.
-
updateDelete
Description copied from interface:UpdateableRecommenderUpdates the values of the recommender, considering that a rating has been deleted.- Parameters:
u- the user.i- the item.val- the value.
-