Min-max scaler train

Updated at:

Min Max Scaler Train scales numeric columns to a target value range using min-max normalization. Use it in data preprocessing pipelines to bring features with different scales—such as one column ranging from 0 to 1 and another from 10,000 to 100,000—into the same range before training a model.

After the component runs, it produces a min-max normalization model that the Min Max Scaler Batch Predict component can apply to new data.

How it works

Min Max Scaler Train scales each value in two steps:

  1. Standardize the value to a [0, 1] range based on the column's observed minimum and maximum:

    X_std = (value - column_min) / (column_max - column_min)
  2. Map the standardized value to the target range [min, max]:

    X_scaled = X_std × (max - min) + min

By default, min is 0.0 and max is 1.0, so the output falls in [0, 1].

Supported computing engines

MaxCompute and Apache Flink.

Configure the component in Machine Learning Designer

Input ports

Input portData typeRecommended upstream componentRequired
dataIntegerNoneYes

Component parameters

TabParameterDescription
Field SettingselectedColsThe numeric columns to scale. Only columns of the numeric type are supported.
Parameter SettingmaxUpper bound of the target range. Must be a DOUBLE value. Default: 1.0.
Parameter SettingminLower bound of the target range. Must be a DOUBLE value. Default: 0.0.
Execution TuningNumber of WorkersNumber of workers. Must be a positive integer in the range [1, 9999]. Use together with Memory per worker, unit MB.
Execution TuningMemory per worker, unit MBMemory allocated to each worker, in MB. Valid values: 1024–65536.

Output ports

Output portStorageRecommended downstream componentModel type
modelN/AMin Max Scaler Batch PredictNone

Example

The following code replicates this component's behavior using the PyAlink Script component. Copy it into the PyAlink Script code editor.

from pyalink.alink import *

def main(sources, sinks, parameter):
    data = sources[0]
    selectedColNames = ["col2", "col3"]
    trainOp = MinMaxScalerTrainBatchOp()\
               .setSelectedCols(selectedColNames)
    result = trainOp.linkFrom(data)
    result.link(sinks[0])
    BatchOperator.execute()

What's next