@Shareable public class DefaultItemVectorNormalizer extends java.lang.Object implements ItemVectorNormalizer, java.io.Serializable
Default item vector normalizer that delegates to a generic VectorNormalizer
.
Modifier and Type | Field and Description |
---|---|
protected VectorNormalizer |
delegate |
Constructor and Description |
---|
DefaultItemVectorNormalizer()
Construct a new item vector normalizer that uses the identity normalization.
|
DefaultItemVectorNormalizer(VectorNormalizer norm)
Construct a new item vector normalizer wrapping a generic vector normalizer.
|
Modifier and Type | Method and Description |
---|---|
VectorNormalizer |
getVectorNormalizer()
Get the underlying vector normalizer.
|
InvertibleFunction<Long2DoubleMap,Long2DoubleMap> |
makeTransformation(long itemId,
Long2DoubleMap vector)
Make a vector transformation for a item.
|
protected final VectorNormalizer delegate
public DefaultItemVectorNormalizer()
Construct a new item vector normalizer that uses the identity normalization.
@Inject public DefaultItemVectorNormalizer(VectorNormalizer norm)
Construct a new item vector normalizer wrapping a generic vector normalizer.
norm
- The generic normalizer to use.public InvertibleFunction<Long2DoubleMap,Long2DoubleMap> makeTransformation(long itemId, Long2DoubleMap vector)
ItemVectorNormalizer
Make a vector transformation for a item. The resulting transformation will be applied to item vectors to normalize and denormalize them.
makeTransformation
in interface ItemVectorNormalizer
itemId
- The item ID to normalize for.vector
- The item’s vector to use as the reference vector.public VectorNormalizer getVectorNormalizer()
Get the underlying vector normalizer.