Array Transformation
array_transformTransform 2D arrays for ML preprocessing: L2 normalization, Z-score standardization, min-max scaling to [0,1], or log transformation. Input data and select transform type.
Instructions
Transform arrays for ML preprocessing and data normalization.
Transformations: - normalize: L2 normalization (unit vector) - standardize: Z-score (mean=0, std=1) - minmax_scale: Scale to [0,1] range - log_transform: Natural log transform
Examples:
L2 NORMALIZATION: data=[[3,4]], transform="normalize" Result: [[0.6,0.8]] (3²+4²=25, √25=5, 3/5=0.6, 4/5=0.8)
STANDARDIZATION (Z-SCORE): data=[[1,2],[3,4]], transform="standardize" Result: Values with mean=0, std=1
MIN-MAX SCALING: data=[[1,2],[3,4]], transform="minmax_scale" Result: [[0,0.33],[0.67,1]] (scaled to [0,1])
LOG TRANSFORM: data=[[1,10,100]], transform="log_transform" Result: [[0,2.3,4.6]] (natural log)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification. | |
| output_mode | No | Output format: full (default), compact, minimal, value, or final. See batch_execute tool for details. | full |
| data | Yes | 2D array to transform (e.g., [[1,2],[3,4]]) | |
| transform | Yes | Transformation type | |
| axis | No | Axis: 0=column-wise, 1=row-wise, None=overall |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |