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>
factorization
The current matrix factorization.private UpdateableFactorizer<U,I>
factorizer
The 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.FastRecommendation
getRecommendation(int uidx, int maxLength, java.util.function.IntPredicate filter)
es.uam.eps.ir.ranksys.fast.FastRecommendation
getRecommendation(int uidx, java.util.stream.IntStream candidates)
void
update(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.void
update(U u, I i, double val)
Updates the values of the recommender, considering that a new rating has been added.void
updateAddItem(I i)
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,I,java.lang.Double>> tuples)
Updates the values of the recommender, considering that the following preferences have been removed.void
updateDelete(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, user2uidx
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
-
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:
getRecommendation
in interfacees.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,I>
- Specified by:
getRecommendation
in classAbstractFastUpdateableRecommender<U,I>
-
getRecommendation
public es.uam.eps.ir.ranksys.fast.FastRecommendation getRecommendation(int uidx, java.util.stream.IntStream candidates)- Specified by:
getRecommendation
in interfacees.uam.eps.ir.ranksys.rec.fast.FastRecommender<U,I>
- Overrides:
getRecommendation
in classAbstractFastUpdateableRecommender<U,I>
-
updateAddUser
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
Description copied from interface:UpdateableRecommender
Updates 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:UpdateableRecommender
Updates 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:UpdateableRecommender
Updates 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:UpdateableRecommender
Updates 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:UpdateableRecommender
Updates the values of the recommender, considering that a rating has been deleted.- Parameters:
u
- the user.i
- the item.val
- the value.
-