Class PurePersonalizedPageRank<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.standalone.randomwalk.PurePersonalizedPageRank<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 PurePersonalizedPageRank<U> extends UserFastRankingRecommender<U>
Recommender algorithm based in a modified Personalized PageRank.
-
Field Summary
Fields Modifier and Type Field Description private doublelambdaThe teleport rateprivate static intMAXITERMaximum number of iterations.private booleanS2UIndicates if teleports always go to the origin node.private booleansimpleIn case it is true, the target node (or root/origin node) can only be accessed via teleport by a random walker.private static doubleTHRESHOLDConvergence threshold.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
graph -
Constructor Summary
Constructors Constructor Description PurePersonalizedPageRank(FastGraph<U> graph, double lambda, boolean simple, boolean S2U)Constructor -
Method Summary
Modifier and Type Method Description protected java.util.Map<U,java.lang.Double>calculatePagerank(U uId)Calculates the PageRank valueit.unimi.dsi.fastutil.ints.Int2DoubleMapgetScoresMap(int i)Methods inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
getFreq, getFreq, getGraphMethods inherited from class es.uam.eps.ir.ranksys.rec.fast.FastRankingRecommender
getRecommendationMethods inherited from class es.uam.eps.ir.ranksys.rec.fast.AbstractFastRecommender
getRecommendation, 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
-
simple
private final boolean simpleIn case it is true, the target node (or root/origin node) can only be accessed via teleport by a random walker. In other case, with some probability, the node can be accessed by its incoming neighbors. -
S2U
private final boolean S2UIndicates if teleports always go to the origin node. In case it is false, when the random walker arrives to a sink, it might teleport to the any of the other nodes. -
lambda
private final double lambdaThe teleport rate -
THRESHOLD
private static final double THRESHOLDConvergence threshold.- See Also:
- Constant Field Values
-
MAXITER
private static final int MAXITERMaximum number of iterations.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PurePersonalizedPageRank
Constructor- Parameters:
graph- the original graph.lambda- the teleport rate.simple- indicates if the target node can only be accessed via teleport or not.S2U- Indicates if teleports always go to the origin node.
-
-
Method Details
-
getScoresMap
public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap(int i) -
calculatePagerank
Calculates the PageRank value- Parameters:
uId- root node.- Returns:
- The PageRank value for all the nodes.
-