@DefaultImplementation(value=DefaultItemVectorNormalizer.class) public interface ItemVectorNormalizer
Normalizes an item’s vector.
Modifier and Type | Method and Description |
---|---|
InvertibleFunction<Long2DoubleMap,Long2DoubleMap> |
makeTransformation(long itemId,
Long2DoubleMap vector)
Make a vector transformation for a item.
|
VectorTransformation |
makeTransformation(long itemId,
SparseVector vector)
Deprecated.
|
MutableSparseVector |
normalize(long itemId,
SparseVector vector,
MutableSparseVector target)
Deprecated.
Old vectors are going away.
|
@Deprecated MutableSparseVector normalize(long itemId, @Nonnull SparseVector vector, @Nullable MutableSparseVector target)
Normalize a vector with respect to an item vector.
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.target
vector, if specified. Otherwise, a fresh mutable vector containing a normalized copy of the item vector is returned.@Deprecated VectorTransformation makeTransformation(long itemId, SparseVector vector)
makeTransformation(long, Long2DoubleMap)
.Make a vector transformation for an item. The resulting transformation will be applied to item vectors to normalize and denormalize them.
itemId
- The item id to normalize for.vector
- The item’s vector to use as the reference vector.InvertibleFunction<Long2DoubleMap,Long2DoubleMap> makeTransformation(long itemId, Long2DoubleMap vector)
Make a vector transformation for a item. The resulting transformation will be applied to item vectors to normalize and denormalize them.
itemId
- The item ID to normalize for.vector
- The item’s vector to use as the reference vector.