org.apache.spark.mllib.feature
Class StandardScalerModel

Object
  extended by 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

Constructor Summary
StandardScalerModel(Vector std)
           
StandardScalerModel(Vector std, Vector mean)
           
StandardScalerModel(Vector std, Vector mean, boolean withStd, boolean withMean)
           
 
Method Summary
 Vector mean()
           
 StandardScalerModel setWithMean(boolean withMean)
           
 StandardScalerModel setWithStd(boolean withStd)
           
 Vector std()
           
 Vector transform(Vector vector)
          Applies standardization transformation on a vector.
 boolean withMean()
           
 boolean withStd()
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.mllib.feature.VectorTransformer
transform, transform
 

Constructor Detail

StandardScalerModel

public StandardScalerModel(Vector std,
                           Vector mean,
                           boolean withStd,
                           boolean withMean)

StandardScalerModel

public StandardScalerModel(Vector std,
                           Vector mean)

StandardScalerModel

public StandardScalerModel(Vector std)
Method Detail

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.