org.grouplens.lenskit.transform.normalize

## Interface UserVectorNormalizer

• ### Method Summary

All Methods
Modifier and Type Method and Description
VectorTransformation makeTransformation(long user, SparseVector vector)
Make a vector transformation for a user.
MutableSparseVector normalize(long user, SparseVector vector, MutableSparseVector target)
Normalize a vector with respect to a user vector.
• ### Method Detail

• #### normalize

MutableSparseVector normalize(long user,
@Nonnull
SparseVector vector,
@Nullable
MutableSparseVector target)
Normalize a vector with respect to a user vector.
Parameters:
user - The user to normalize a vector for.
vector - The user's vector for reference.
target - The vector to normalize. If null, the user vector is normalized.
Returns:
The target vector, if specified. Otherwise, a fresh mutable vector containing a normalized copy of the user vector is returned.
• #### makeTransformation

VectorTransformation makeTransformation(long user,
SparseVector vector)
Make a vector transformation for a user. The resulting transformation will be applied to user vectors to normalize and denormalize them.
Parameters:
user - The user ID to normalize for.
vector - The user's vector to use as the reference vector.
Returns:
The vector transformaition normalizing for this user.