Min-max scaler train
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:
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)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 port | Data type | Recommended upstream component | Required |
|---|---|---|---|
| data | Integer | None | Yes |
Component parameters
| Tab | Parameter | Description |
|---|---|---|
| Field Setting | selectedCols | The numeric columns to scale. Only columns of the numeric type are supported. |
| Parameter Setting | max | Upper bound of the target range. Must be a DOUBLE value. Default: 1.0. |
| Parameter Setting | min | Lower bound of the target range. Must be a DOUBLE value. Default: 0.0. |
| Execution Tuning | Number of Workers | Number of workers. Must be a positive integer in the range [1, 9999]. Use together with Memory per worker, unit MB. |
| Execution Tuning | Memory per worker, unit MB | Memory allocated to each worker, in MB. Valid values: 1024–65536. |
Output ports
| Output port | Storage | Recommended downstream component | Model type |
|---|---|---|---|
| model | N/A | Min Max Scaler Batch Predict | None |
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
Apply the trained model to new data: Min Max Scaler Batch Predict