Class AdamicAdar<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.foaf.AdamicAdar<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 AdamicAdar<U> extends UserFastRankingRecommender<U>
Recommender that uses the Adamic-Adar coefficient of the neighbours. It weights the common neighbors between
the target and the candidate users by the inverse of the logarithm of the degree of such common user.
Reference: Adamic, L.A., Adar, E.: Friends and neighbors on the Web. Social Networks, 25(3), 211–230 (2003)
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
uSel
Neighborhood selection for the target users.private EdgeOrientation
vSel
Neighborhood selection for the candidate users.private EdgeOrientation
wSel
Neighborhood selection for the intermediate usersprivate it.unimi.dsi.fastutil.ints.Int2DoubleMap
wSizes
Map containing the length of the common neighborhoods between target and candidate users.Fields inherited from class es.uam.eps.ir.relison.links.recommendation.UserFastRankingRecommender
graph
-
Constructor Summary
Constructors Constructor Description AdamicAdar(FastGraph<U> graph, EdgeOrientation uSel, EdgeOrientation vSel, EdgeOrientation wSel)
Constructor. -
Method Summary
Modifier and Type Method Description 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
-
wSizes
private final it.unimi.dsi.fastutil.ints.Int2DoubleMap wSizesMap containing the length of the common neighborhoods between target and candidate users. -
uSel
Neighborhood selection for the target users. -
vSel
Neighborhood selection for the candidate users. -
wSel
Neighborhood selection for the intermediate users
-
-
Constructor Details
-
AdamicAdar
public AdamicAdar(FastGraph<U> graph, EdgeOrientation uSel, EdgeOrientation vSel, EdgeOrientation wSel)Constructor.- Parameters:
graph
- the graph.uSel
- the neighborhood selection for the target user.vSel
- the neighborhood selection for the candidate user.wSel
- the neighborhood selection for the users in the intersection
-
-
Method Details
-
getScoresMap
public it.unimi.dsi.fastutil.ints.Int2DoubleMap getScoresMap(int uidx)
-