public class BaselineSubtractingUserVectorNormalizer extends AbstractUserVectorNormalizer
User vector normalizer that subtracts a user’s baseline scores.
Modifier and Type | Field and Description |
---|---|
protected ItemScorer |
baselineScorer |
Constructor and Description |
---|
BaselineSubtractingUserVectorNormalizer(ItemScorer baseline)
Create a new baseline-subtracting normalizer with the given baseline.
|
Modifier and Type | Method and Description |
---|---|
InvertibleFunction<Long2DoubleMap,Long2DoubleMap> |
makeTransformation(long user,
Long2DoubleMap vector)
Make a vector transformation for a user.
|
VectorTransformation |
makeTransformation(long user,
SparseVector ratings)
Make a vector transformation for a user.
|
String |
toString() |
normalize
protected final ItemScorer baselineScorer
@Inject public BaselineSubtractingUserVectorNormalizer(@BaselineScorer ItemScorer baseline)
Create a new baseline-subtracting normalizer with the given baseline.
baseline
- The baseline scorer to use for normalization.public VectorTransformation makeTransformation(long user, SparseVector ratings)
UserVectorNormalizer
Make a vector transformation for a user. The resulting transformation will be applied to user vectors to normalize and denormalize them.
user
- The user ID to normalize for.ratings
- The user’s vector to use as the reference vector.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.
user
- The user ID to normalize for.vector
- The user’s vector to use as the reference vector.