public class Neighbor
extends java.lang.Object
Representation of a single neighboring user.
| Modifier and Type | Field and Description |
|---|---|
double |
similarity |
static java.util.Comparator<Neighbor> |
SIMILARITY_COMPARATOR
Comparator to order neighbors by similarity.
|
long |
user |
Long2DoubleMap |
vector |
| Constructor and Description |
|---|
Neighbor(long u,
Long2DoubleMap v,
double sim)
Construct a new neighbor.
|
public final long user
public final Long2DoubleMap vector
public final double similarity
public static final java.util.Comparator<Neighbor> SIMILARITY_COMPARATOR
Comparator to order neighbors by similarity.
public Neighbor(long u,
Long2DoubleMap v,
double sim)
Construct a new neighbor.
u - The neighbor’s ID.v - The neighbor’s normalized rating vector.sim - The neighbor’s similarity to the query user.