org.apache.spark.mllib.feature
Class StandardScalerModel
Object
org.apache.spark.mllib.feature.StandardScalerModel
- All Implemented Interfaces:
- java.io.Serializable, VectorTransformer
public class StandardScalerModel
- extends Object
- implements VectorTransformer
:: Experimental ::
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:
- Serialized Form
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardScalerModel
public StandardScalerModel(Vector std,
Vector mean,
boolean withStd,
boolean withMean)
StandardScalerModel
public StandardScalerModel(Vector std,
Vector mean)
StandardScalerModel
public StandardScalerModel(Vector std)
std
public Vector std()
mean
public Vector mean()
withStd
public boolean withStd()
withMean
public boolean withMean()
setWithMean
public StandardScalerModel setWithMean(boolean withMean)
setWithStd
public StandardScalerModel setWithStd(boolean withStd)
transform
public Vector transform(Vector vector)
- Applies standardization transformation on a vector.
- Specified by:
transform
in interface VectorTransformer
- Parameters:
vector
- Vector to be standardized.
- Returns:
- Standardized vector. If the std of a column is zero, it will return default
0.0
for the column with zero std.