U
- type of the usersI
- type of the itemspublic abstract class AbstractFastRecommender<U,I> extends AbstractRecommender<U,I> implements FastRecommender<U,I>
Modifier and Type | Field and Description |
---|---|
protected FastItemIndex<I> |
iIndex
Fast item index.
|
protected FastUserIndex<U> |
uIndex
Fast user index.
|
Constructor and Description |
---|
AbstractFastRecommender(FastUserIndex<U> uIndex,
FastItemIndex<I> iIndex)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FastRecommendation |
getRecommendation(int uidx)
Free recommendation.
|
FastRecommendation |
getRecommendation(int uidx,
int maxLength)
Free recommendation.
|
abstract FastRecommendation |
getRecommendation(int uidx,
int maxLength,
IntPredicate filter)
Filter recommendation.
|
FastRecommendation |
getRecommendation(int uidx,
IntPredicate filter)
Filter recommendation.
|
FastRecommendation |
getRecommendation(int uidx,
IntStream candidates)
Candidates ranking.
|
Recommendation<U,I> |
getRecommendation(U u,
int maxLength)
Free recommendation.
|
Recommendation<U,I> |
getRecommendation(U u,
int maxLength,
Predicate<I> filter)
Filter recommendation.
|
Recommendation<U,I> |
getRecommendation(U u,
Stream<I> candidates)
Candidates ranking.
|
I |
iidx2item(int iidx)
Returns the item represented with the index.
|
int |
item2iidx(I i)
Returns the index assigned to the item.
|
int |
numItems()
Counts the number of indexed items.
|
int |
numUsers()
Counts the number of indexed users.
|
U |
uidx2user(int uidx)
Returns the user represented with the index.
|
int |
user2uidx(U u)
Returns the index assigned to the user.
|
getRecommendation, getRecommendation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRecommendation, getRecommendation
containsUser, getAllUidx, getAllUsers, uidx2user, uidx2user, user2uidx, user2uidx
containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx
protected final FastUserIndex<U> uIndex
protected final FastItemIndex<I> iIndex
public AbstractFastRecommender(FastUserIndex<U> uIndex, FastItemIndex<I> iIndex)
uIndex
- user indexiIndex
- item indexpublic int numUsers()
UserIndex
public int user2uidx(U u)
FastUserIndex
user2uidx
in interface FastUserIndex<U>
u
- userpublic U uidx2user(int uidx)
FastUserIndex
uidx2user
in interface FastUserIndex<U>
uidx
- user indexpublic int numItems()
ItemIndex
public int item2iidx(I i)
FastItemIndex
item2iidx
in interface FastItemIndex<I>
i
- itempublic I iidx2item(int iidx)
FastItemIndex
iidx2item
in interface FastItemIndex<I>
iidx
- item indexpublic Recommendation<U,I> getRecommendation(U u, int maxLength)
Recommender
getRecommendation
in interface Recommender<U,I>
getRecommendation
in class AbstractRecommender<U,I>
u
- user to be issued a recommendationmaxLength
- maximum length of recommendationpublic FastRecommendation getRecommendation(int uidx)
FastRecommender
getRecommendation
in interface FastRecommender<U,I>
uidx
- index of the user to be issued a recommendationpublic FastRecommendation getRecommendation(int uidx, int maxLength)
FastRecommender
getRecommendation
in interface FastRecommender<U,I>
uidx
- index of the user to be issued a recommendationmaxLength
- maximum length of recommendationpublic Recommendation<U,I> getRecommendation(U u, int maxLength, Predicate<I> filter)
Recommender
getRecommendation
in interface Recommender<U,I>
getRecommendation
in class AbstractRecommender<U,I>
u
- user to be issued a recommendationmaxLength
- maximum length of recommendationfilter
- filter to decide which items might be recommendedpublic FastRecommendation getRecommendation(int uidx, IntPredicate filter)
FastRecommender
getRecommendation
in interface FastRecommender<U,I>
uidx
- index of the user to be issued a recommendationfilter
- (fast) filter to decide which items might be recommendedpublic abstract FastRecommendation getRecommendation(int uidx, int maxLength, IntPredicate filter)
FastRecommender
getRecommendation
in interface FastRecommender<U,I>
uidx
- index of the user to be issued a recommendationmaxLength
- maximum length of recommendationfilter
- (fast) filter to decide which items might be recommendedpublic Recommendation<U,I> getRecommendation(U u, Stream<I> candidates)
Recommender
getRecommendation
in interface Recommender<U,I>
getRecommendation
in class AbstractRecommender<U,I>
u
- user to be issued a recommendationcandidates
- candidate items to be included in the recommendationpublic FastRecommendation getRecommendation(int uidx, IntStream candidates)
FastRecommender
getRecommendation
in interface FastRecommender<U,I>
uidx
- item of the user to be issued a recommendationcandidates
- candidate items to be included in the recommendationCopyright © 2016. All rights reserved.