Class UpdateableFactorizer<U,I>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.updateable.mf.UpdateableFactorizer<U,I>
- Type Parameters:
U
- type of the usersI
- type of the items
- Direct Known Subclasses:
ALSUpdateableFactorizer
public abstract class UpdateableFactorizer<U,I>
extends java.lang.Object
UpdateableFactorizer. Abstract class for matrix factorization algorithms.
-
Constructor Summary
Constructors Constructor Description UpdateableFactorizer()
-
Method Summary
Modifier and Type Method Description abstract double
error(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data)
Global loss of the factorization.abstract UpdateableFactorization<U,I>
factorize(int K, FastUpdateablePreferenceData<U,I> data)
Creates and calculates a factorization.abstract void
factorize(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data)
Calculates the factorization by using a previously generate matrix factorization.abstract void
update(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data, U u, I i, double weight)
Updates the factorization.abstract void
updateDelete(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data, U u, I i)
Updates the factorization when a rating is removed.
-
Constructor Details
-
UpdateableFactorizer
public UpdateableFactorizer()
-
-
Method Details
-
error
public abstract double error(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data)Global loss of the factorization.- Parameters:
factorization
- matrix factorizationdata
- preference data- Returns:
- the global loss
-
factorize
public abstract UpdateableFactorization<U,I> factorize(int K, FastUpdateablePreferenceData<U,I> data)Creates and calculates a factorization.- Parameters:
K
- size of the latent feature space.data
- preference data- Returns:
- a matrix factorization
-
factorize
public abstract void factorize(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data)Calculates the factorization by using a previously generate matrix factorization.- Parameters:
factorization
- matrix factorizationdata
- preference data
-
update
public abstract void update(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data, U u, I i, double weight)Updates the factorization.- Parameters:
factorization
- an updateable factorizationdata
- preference datau
- the useri
- the itemweight
- the rating for the item i provided by the user u
-
updateDelete
public abstract void updateDelete(UpdateableFactorization<U,I> factorization, FastUpdateablePreferenceData<U,I> data, U u, I i)Updates the factorization when a rating is removed.- Parameters:
factorization
- an updateable factorizationdata
- preference datau
- the useri
- the item
-