public class RobustScaler extends Object implements Estimator<RobustScaler,RobustScalerModel>, RobustScalerParams<RobustScaler>
This Scaler removes the median and scales the data according to the quantile range (defaults to IQR: Interquartile Range). The IQR is the range between the 1st quartile (25th quantile) and the 3rd quartile (75th quantile) but can be configured.
Centering and scaling happen independently on each feature by computing the relevant statistics on the samples in the training set. Median and quantile range are then stored to be used on later data using the transform method.
Standardization of a dataset is a common requirement for many machine learning estimators. Typically this is done by removing the mean and scaling to unit variance. However, outliers can often influence the sample mean / variance in a negative way. In such cases, the median and the interquartile range often give better results.
Note that NaN values are ignored in the computation of medians and ranges.
LOWER, UPPER
RELATIVE_ERROR
WITH_CENTERING, WITH_SCALING
INPUT_COL
OUTPUT_COL
Constructor and Description |
---|
RobustScaler() |
Modifier and Type | Method and Description |
---|---|
RobustScalerModel |
fit(org.apache.flink.table.api.Table... inputs)
Trains on the given inputs and produces a Model.
|
Map<Param<?>,Object> |
getParamMap()
Returns a map which should contain value for every parameter that meets one of the following
conditions.
|
static RobustScaler |
load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv,
String path) |
void |
save(String path)
Saves the metadata and bounded data of this stage to the given path.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLower, getUpper, setLower, setUpper
getRelativeError, setRelativeError
getWithCentering, getWithScaling, setWithCentering, setWithScaling
getInputCol, setInputCol
getOutputCol, setOutputCol
get, getParam, set
public RobustScalerModel fit(org.apache.flink.table.api.Table... inputs)
Estimator
fit
in interface Estimator<RobustScaler,RobustScalerModel>
inputs
- a list of tablespublic void save(String path) throws IOException
Stage
save
in interface Stage<RobustScaler>
IOException
public static RobustScaler load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv, String path) throws IOException
IOException
public Map<Param<?>,Object> getParamMap()
WithParams
1) set(...) has been called to set value for this parameter.
2) The parameter is a public final field of this WithParams instance. This includes fields inherited from its interfaces and super-classes.
The subclass which implements this interface could meet this requirement by returning a
member field of the given map type, after having initialized this member field using the
ParamUtils.initializeMapWithDefaultValues(Map, WithParams)
method.
getParamMap
in interface WithParams<RobustScaler>
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.