org.grouplens.lenskit.transform.normalize

## Interface ItemVectorNormalizer

• All Known Implementing Classes:
DefaultItemVectorNormalizer

@DefaultImplementation(value=DefaultItemVectorNormalizer.class)
public interface ItemVectorNormalizer
Normalizes an item's vector.
• ### Method Summary

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

• #### normalize

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

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