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