K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.public final class StandardScalerPreprocessor<K,V> extends Object implements Preprocessor<K,V>, DeployableObject
mean
equal to 0
and variance
equal to 1
. From mathematical point of view it's the following function which is applied
to every element in a dataset:
a_i = (a_i - mean_i) / sigma_i for all i
,
where i
is a number of column, mean_i
is the mean value this column and sigma_i
is the
standard deviation in this column.Constructor and Description |
---|
StandardScalerPreprocessor(double[] means,
double[] sigmas,
Preprocessor<K,V> basePreprocessor)
Constructs a new instance of standardscaling preprocessor.
|
Modifier and Type | Method and Description |
---|---|
LabeledVector |
apply(K k,
V v)
Applies this preprocessor.
|
List<Object> |
getDependencies()
Returns dependencies of this object that can be object with class defined by client side and unknown for server.
|
double[] |
getMeans() |
double[] |
getSigmas() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
map
andThen
andThen
public StandardScalerPreprocessor(double[] means, double[] sigmas, Preprocessor<K,V> basePreprocessor)
means
- Means of each column.sigmas
- Standard deviations in each column.basePreprocessor
- Base preprocessor.public LabeledVector apply(K k, V v)
apply
in interface BiFunction<K,V,LabeledVector>
k
- Key.v
- Value.public double[] getMeans()
public double[] getSigmas()
public List<Object> getDependencies()
getDependencies
in interface DeployableObject
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024