Class MatrixBasedRecommender<U>
java.lang.Object
es.uam.eps.ir.ranksys.rec.AbstractRecommender<U,I>
es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender<U,I>
es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender<U,U>
es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender<U>
es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender<U>
- 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>
- Direct Known Subclasses:
AbstractHittingTime
,GlobalMatrixBasedRecommender
public abstract class MatrixBasedRecommender<U> extends UserFastRankingRecommender<U>
Abstract implementation of a contact recommendation algorithm that depends on matrix operations.
-
Field Summary
Fields Modifier and Type Field Description protected MatrixLibrary
library
The matrix library to consider.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
graph
-
Constructor Summary
Constructors Constructor Description MatrixBasedRecommender(FastGraph<U> graph)
Default constructor.MatrixBasedRecommender(FastGraph<U> graph, MatrixLibrary library)
Constructor. -
Method Summary
Modifier and Type Method Description protected abstract double[][]
getCOLTMatrix(int uidx)
Obtains the matrix that provides the ratings given the target user, using the COLT library.protected abstract double[][]
getJBLASMatrix(int uidx)
Obtains the matrix that provides the ratings given the target user, using the JBLAS library.double[][]
getMatrix(int uidx)
Obtains the matrix that provides the ratings given the target user.protected abstract double[][]
getMTJMatrix(int uidx)
Obtains the matrix that provides the ratings given the target user, using the MTJ library.it.unimi.dsi.fastutil.ints.Int2DoubleMap
getScoresMap(int uidx)
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
getFreq, getFreq, getGraph
Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender
getRecommendation
Methods inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender
getRecommendation, 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
-
library
The matrix library to consider.
-
-
Constructor Details
-
MatrixBasedRecommender
Constructor.- Parameters:
graph
- a fast graph representing the social network.library
- the matrix library to use.
-
MatrixBasedRecommender
Default constructor. If possible, uses the JBLAS library. Otherwise, it takes the COLT library.- Parameters:
graph
- a fast graph representing the social network.
-
-
Method Details
-
getScoresMap
public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap(int uidx) -
getMatrix
public double[][] getMatrix(int uidx)Obtains the matrix that provides the ratings given the target user.- Parameters:
uidx
- the target user.- Returns:
- the matrix containing the item scores in the uidx row.
-
getJBLASMatrix
protected abstract double[][] getJBLASMatrix(int uidx)Obtains the matrix that provides the ratings given the target user, using the JBLAS library.- Parameters:
uidx
- the target user.- Returns:
- the matrix containing the item scores in the uidx row.
-
getCOLTMatrix
protected abstract double[][] getCOLTMatrix(int uidx)Obtains the matrix that provides the ratings given the target user, using the COLT library.- Parameters:
uidx
- the target user.- Returns:
- the matrix containing the item scores in the uidx row.
-
getMTJMatrix
protected abstract double[][] getMTJMatrix(int uidx)Obtains the matrix that provides the ratings given the target user, using the MTJ library.- Parameters:
uidx
- the target user.- Returns:
- the matrix containing the item scores in the uidx row.
-