public class Normalizer extends Object implements VectorTransformer
For any 1 <= p < Double.PositiveInfinity, normalizes samples using sum(abs(vector).^p^)^(1/p)^ as norm.
For p = Double.PositiveInfinity, max(abs(vector)) will be used as norm for normalization.
param: p Normalization in L^p^ space, p = 2 by default.
Constructor and Description |
---|
Normalizer() |
Normalizer(double p) |
Modifier and Type | Method and Description |
---|---|
Vector |
transform(Vector vector)
Applies unit length normalization on a vector.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform, transform
public Vector transform(Vector vector)
transform
in interface VectorTransformer
vector
- vector to be normalized.