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