@Shareable public class IdentityVectorNormalizer extends AbstractVectorNormalizer implements Serializable
Identity normalization (makes no change).
Constructor and Description |
---|
IdentityVectorNormalizer() |
Modifier and Type | Method and Description |
---|---|
VectorTransformation |
makeTransformation(Long2DoubleMap reference)
Create a vector transformation that normalizes and denormalizes vectors with respect to a reference vector.
|
VectorTransformation |
makeTransformation(SparseVector ratings)
Create a vector transformation that normalizes and denormalizes vectors with respect to the specified entity.
|
normalize
public VectorTransformation makeTransformation(SparseVector ratings)
VectorNormalizer
Create a vector transformation that normalizes and denormalizes vectors with respect to the specified entity. This allows transformations to be applied multiple times to different vectors and also unapplied.
If the reference vector is empty, the returned transformation should be the identity transform. Results are undefined if the reference vector is not complete or contains NaN values.
If the normalization needs to retain a copy of the sparse vector, it will take an immutable copy.
makeTransformation
in interface VectorNormalizer
ratings
- The reference vector.public VectorTransformation makeTransformation(Long2DoubleMap reference)
VectorNormalizer
Create a vector transformation that normalizes and denormalizes vectors with respect to a reference vector. The reference vector is used to compute any data needed for the normalization. For example, a mean-centering normalization will subtract the mean of the reference vector from any vector to which it is applied, and add back the reference mean when it is unapplied.
This allows transformations to be applied multiple times to different vectors and also unapplied.
If the reference vector is empty, the returned transformation should be the identity transform. Results are undefined if the reference vector is not complete or contains NaN values.
If the normalization needs to retain a copy of the sparse vector, it will take an immutable copy.
makeTransformation
in interface VectorNormalizer
reference
- The reference vector.