Class PseudoInverseCosine<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.PseudoInverseCosine<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 PseudoInverseCosine<U> extends GlobalMatrixBasedRecommender<U>
Implementation of the pseudo inverse cosine algorithm for contact recommendation. This algorithm first computes the
pseudo inverse of the Laplacian matrix (obtaining, for each user, a vector representation).
Then, it takes the cosine similarity (which is computed as the (u,v) coordinate of the matrix, divided by
the square root of the product of the (u,u) and (v,v) coordinates).
References:
References:
- F. Fouss, A. Pirotte, J-M. Renders, M. Saerens. Random-walk computatin of similarities between nodes of a graph with application to collaborative recommendation. IEEE TKDE 19(3), pp. 355-369 (2007)
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
orient
The orientation for the Laplacian matrix.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.GlobalMatrixBasedRecommender
matrix
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 PseudoInverseCosine(FastGraph<U> graph)
Constructor.PseudoInverseCosine(FastGraph<U> graph, 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, getMTJMatrix
Methods inherited from class es.uam.eps.ir.relison.links.recommendation.algorithms.MatrixBasedRecommender
getMatrix, 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
-
orient
The orientation for the Laplacian matrix.
-
-
Constructor Details
-
PseudoInverseCosine
Constructor. By default, considers network as undirected.- Parameters:
graph
- a fast graph representing the social network.
-
PseudoInverseCosine
Constructor.- Parameters:
graph
- a fast graph representing the social network.orient
- the orientation selection for the adjacency and Laplacian matrices.
-
-
Method Details
-
getJBLASMatrix
protected double[][] getJBLASMatrix()Description copied from class:GlobalMatrixBasedRecommender
Obtains the matrix using the JBLAS library.- Specified by:
getJBLASMatrix
in classGlobalMatrixBasedRecommender<U>
- Returns:
- the matrix.
-
getCOLTMatrix
protected double[][] getCOLTMatrix()Description copied from class:GlobalMatrixBasedRecommender
Obtains the matrix using the COLT library.- Specified by:
getCOLTMatrix
in classGlobalMatrixBasedRecommender<U>
- Returns:
- the matrix.
-
getMTJMatrix
protected double[][] getMTJMatrix()Description copied from class:GlobalMatrixBasedRecommender
Obtains the matrix using the MTJ library.- Specified by:
getMTJMatrix
in classGlobalMatrixBasedRecommender<U>
- Returns:
- the matrix.
-