Package org.apache.spark.mllib.feature
Class StandardScalerModel
Object
org.apache.spark.mllib.feature.StandardScalerModel
- All Implemented Interfaces:
Serializable,VectorTransformer
Represents a StandardScaler model that can transform vectors.
param: std column standard deviation values param: mean column mean values param: withStd whether to scale the data to have unit standard deviation param: withMean whether to center the data before scaling
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStandardScalerModel(Vector std, Vector mean) StandardScalerModel(Vector std, Vector mean, boolean withStd, boolean withMean) -
Method Summary
Modifier and TypeMethodDescriptionmean()setWithMean(boolean withMean) setWithStd(boolean withStd) std()Applies standardization transformation on a vector.booleanwithMean()booleanwithStd()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.mllib.feature.VectorTransformer
transform, transform
-
Constructor Details
-
StandardScalerModel
-
StandardScalerModel
- Parameters:
std- (undocumented)mean- (undocumented)
-
StandardScalerModel
-
-
Method Details
-
mean
-
setWithMean
-
setWithStd
-
std
-
transform
Applies standardization transformation on a vector.- Specified by:
transformin interfaceVectorTransformer- Parameters:
vector- Vector to be standardized.- Returns:
- Standardized vector. If the std of a column is zero, it will return default
0.0for the column with zero std.
-
withMean
public boolean withMean() -
withStd
public boolean withStd()
-