Class PageRankHittingTime<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>
es.uam.eps.ir.relison.links.recommendation.algorithms.standalone.randomwalk.AbstractHittingTime<U>
es.uam.eps.ir.relison.links.recommendation.algorithms.standalone.randomwalk.PageRankHittingTime<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>
public class PageRankHittingTime<U> extends AbstractHittingTime<U>
Implementation of the Hitting time (using the not-personalized
PageRank transition matrix)
-
Field Summary
Fields Modifier and Type Field Description private double[][]
matrix
The hitting time matrix.private double
r
Teleport probability.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender
library
Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
graph
-
Constructor Summary
Constructors Constructor Description PageRankHittingTime(FastGraph<U> graph, double r)
Constructor.PageRankHittingTime(FastGraph<U> graph, MatrixLibrary library, double r)
Constructor. -
Method Summary
Modifier and Type Method Description protected cern.colt.matrix.DoubleMatrix2D
getCOLTTransitionMatrix(int uidx)
Obtains the transition matrix, for its use with the COLT library.protected org.jblas.DoubleMatrix
getJBLASTransitionMatrix(int uidx)
Obtains the transition matrix, for its use with the JBLAS library.double[][]
getMatrix(int uidx)
Obtains the matrix that provides the ratings given the target user.protected no.uib.cipr.matrix.DenseMatrix
getMTJTransitionMatrix(int uidx)
Obtains the transition matrix, for its use with the MTJ library.Methods inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.standalone.randomwalk.AbstractHittingTime
getCOLTMatrix, getJBLASMatrix, getMTJMatrix
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender
getScoresMap
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
-
Constructor Details
-
PageRankHittingTime
Constructor.- Parameters:
graph
- a fast graph representing the social network.r
- teleport probability.
-
PageRankHittingTime
Constructor.- Parameters:
graph
- a fast graph representing the social network.library
- the matrix library to use.r
- teleport probability.
-
-
Method Details
-
getJBLASTransitionMatrix
protected org.jblas.DoubleMatrix getJBLASTransitionMatrix(int uidx)Description copied from class:AbstractHittingTime
Obtains the transition matrix, for its use with the JBLAS library.- Specified by:
getJBLASTransitionMatrix
in classAbstractHittingTime<U>
- Parameters:
uidx
- the target user of the recommendation.- Returns:
- a JBLAS matrix containing the transitions.
-
getCOLTTransitionMatrix
protected cern.colt.matrix.DoubleMatrix2D getCOLTTransitionMatrix(int uidx)Description copied from class:AbstractHittingTime
Obtains the transition matrix, for its use with the COLT library.- Specified by:
getCOLTTransitionMatrix
in classAbstractHittingTime<U>
- Parameters:
uidx
- the target user of the recommendation.- Returns:
- a COLT matrix containing the transitions.
-
getMTJTransitionMatrix
protected no.uib.cipr.matrix.DenseMatrix getMTJTransitionMatrix(int uidx)Description copied from class:AbstractHittingTime
Obtains the transition matrix, for its use with the MTJ library.- Specified by:
getMTJTransitionMatrix
in classAbstractHittingTime<U>
- Parameters:
uidx
- the target user of the recommendation.- Returns:
- a MTJ matrix containing the transitions.
-
getMatrix
public double[][] getMatrix(int uidx)Description copied from class:MatrixBasedRecommender
Obtains the matrix that provides the ratings given the target user.- Overrides:
getMatrix
in classMatrixBasedRecommender<U>
- Parameters:
uidx
- the target user.- Returns:
- the matrix containing the item scores in the uidx row.
-