I
- type of the itemspublic abstract class ItemNeighborhood<I> extends Object implements Neighborhood, FastItemIndex<I>
Modifier and Type | Field and Description |
---|---|
protected FastItemIndex<I> |
iIndex
Fast item index.
|
protected Neighborhood |
neighborhood
Generic neighborhood.
|
Constructor and Description |
---|
ItemNeighborhood(FastItemIndex<I> iIndex,
Neighborhood neighborhood)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Stream<Tuple2od<I>> |
getNeighbors(I i)
Returns a stream of item neighbors
|
Stream<Tuple2id> |
getNeighbors(int idx)
Returns the neighborhood of a user/index.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsItem, getAllIidx, getAllItems, iidx2item, iidx2item, item2iidx, item2iidx
protected final FastItemIndex<I> iIndex
protected final Neighborhood neighborhood
public ItemNeighborhood(FastItemIndex<I> iIndex, Neighborhood neighborhood)
iIndex
- fast item indexneighborhood
- generic fast neighborhoodpublic int numItems()
ItemIndex
public I iidx2item(int iidx)
FastItemIndex
iidx2item
in interface FastItemIndex<I>
iidx
- item indexpublic int item2iidx(I i)
FastItemIndex
item2iidx
in interface FastItemIndex<I>
i
- itempublic Stream<Tuple2id> getNeighbors(int idx)
getNeighbors
in interface Neighborhood
idx
- user/index whose neighborhood is calculatedCopyright © 2016. All rights reserved.