Class LocalPathIndex<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.GlobalMatrixBasedRecommender<U>
es.uam.eps.ir.relison.links.recommendation.algorithms.standalone.pathbased.LocalPathIndex<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 LocalPathIndex<U> extends GlobalMatrixBasedRecommender<U>
Local path index recommender. It takes all paths of distances between 2 and k between the target and candidate
users, and weights them, so shortest paths are more important.
References:
References:
- L. Lü, C. Jin, T. Zhou. Similarity Index Based on Local Paths for Link Prediction of Complex Networks. Physical Review E 80(4): 046122 (2009)
- L. Lü, T. Zhou. Link Prediction in Complex Networks: A survey. Physica A 390(6), 1150-1170 (2011)
-
Field Summary
Fields Modifier and Type Field Description private doublebetaDampening factor.private doublekThe maximum distance between users.private EdgeOrientationorientThe orientation for the adjacency matrix.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.GlobalMatrixBasedRecommender
matrixFields inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender
libraryFields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
graph -
Constructor Summary
Constructors Constructor Description LocalPathIndex(FastGraph<U> graph, double beta, int k)Constructor.LocalPathIndex(FastGraph<U> graph, double beta, int k, EdgeOrientation orient)Constructor. -
Method Summary
Modifier and Type Method Description protected double[][]getCOLTMatrix()Obtains the matrix using the COLT library.protected double[][]getJBLASMatrix()Obtains the matrix using the JBLAS library.protected double[][]getMTJMatrix()Obtains the matrix using the MTJ library.Methods inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.GlobalMatrixBasedRecommender
getCOLTMatrix, getJBLASMatrix, getMatrix, getMTJMatrixMethods inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender
getMatrix, getScoresMapMethods 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
-
Constructor Details
-
LocalPathIndex
Constructor. Takes the outgoing orientation by default.- Parameters:
graph- a fast graph representing the social network.beta- the dampening factor.k- the maximum distance between the target and candidate users (k greater or equal than 2)
-
LocalPathIndex
Constructor.- Parameters:
graph- a fast graph representing the social network.beta- the dampening factor.k- the maximum distance between the target and candidate users (k greater or equal than 2)orient- the orientation for selecting the adjacency matrix.
-
-
Method Details
-
getJBLASMatrix
protected double[][] getJBLASMatrix()Description copied from class:GlobalMatrixBasedRecommenderObtains the matrix using the JBLAS library.- Specified by:
getJBLASMatrixin classGlobalMatrixBasedRecommender<U>- Returns:
- the matrix.
-
getCOLTMatrix
protected double[][] getCOLTMatrix()Description copied from class:GlobalMatrixBasedRecommenderObtains the matrix using the COLT library.- Specified by:
getCOLTMatrixin classGlobalMatrixBasedRecommender<U>- Returns:
- the matrix.
-
getMTJMatrix
protected double[][] getMTJMatrix()Description copied from class:GlobalMatrixBasedRecommenderObtains the matrix using the MTJ library.- Specified by:
getMTJMatrixin classGlobalMatrixBasedRecommender<U>- Returns:
- the matrix.
-