Package org.apache.spark.mllib.feature
Class Normalizer
Object
org.apache.spark.mllib.feature.Normalizer
- All Implemented Interfaces:
- Serializable,- VectorTransformer
Normalizes samples individually to unit L^p^ norm
 
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.
- See Also:
- 
Constructor Details- 
Normalizerpublic Normalizer(double p) 
- 
Normalizerpublic Normalizer()
 
- 
- 
Method Details- 
transformApplies unit length normalization on a vector.- Specified by:
- transformin interface- VectorTransformer
- Parameters:
- vector- vector to be normalized.
- Returns:
- normalized vector. If the norm of the input is zero, it will return the input vector.
 
 
-