Scale
Put numeric values on a common scale before comparing measurements or preparing model inputs. Choose a method for each numeric column and replace its values or keep the results in separate columns.
Scale values from 0 to 1
Manual Input has one value column containing 10, 20, 30 and NULL. Scale applies Min-max with the default output range of 0 to 1.
Scale interactive example
Loading interactive example…
The live example needs a desktop screen. The result it produces is shown here, and the explanation and settings below work on any screen.
| value |
|---|
| 0 |
| 0.5 |
| 1 |
- Select Separate Columns. The original
valuecolumn returns, with the results invalue_scaledbeside it. - Change Output max to
100. The scaled values become 0, 50 and 100; the missing value stays NULL. - Change Method to
Standard. The results are approximately -1.225, 0 and 1.225. The middle value equals the mean, so it becomes 0; NULL stays NULL. Output min and Output max no longer apply. - Change Method to
None. The scaled column disappears and only the original values are left.
When to use
Use Scale to put numeric columns on a comparable scale, usually before training a model. To group numbers into ranges, use Bin.
Read the output
With the initial settings, value contains 0, 0.5, 1 and NULL. The smallest input, 10, maps to 0; the largest, 30, maps to 1. The midpoint, 20, maps to 0.5.
With Separate Columns selected, value keeps the original numbers and value_scaled has the scaled values. All four rows stay, including the missing value.
Standard centers these values on their mean of 20. It produces approximately -1.225, 0 and 1.225, measuring each value's distance from the mean in population standard deviations. Standard and Robust don't use the min-max output range.
To convert formatted numeric text before scaling, use Number.
To represent text categories numerically, use Encode.
Inputs and outputs
Inputs
1 port- InRequired
Accepts: Tables, Geospatial data.
Accepts one connection on this port.
Outputs
1 port- Out
Configure the block
Choose a scaling method for each numeric column, then decide where to put the results. A chosen column missing from the input is skipped with a warning, and its settings are kept.
- Method
None keeps a column unchanged. Min-max maps its minimum and maximum to your chosen range. Standard subtracts the mean and divides by population standard deviation. Robust subtracts the median and divides by the interquartile range. Default: None.
- Min-max all numeric / Standard all numeric / Robust all numeric
Apply the chosen method to every numeric column. Text and other nonnumeric columns remain unchanged.
- Clear all
Set every column's method to None.
- Output min / Output max
Shown when Min-max is selected. Set the lower and upper bounds; Output min must be less than Output max. Default: 0, 1.
- Separate Columns
Keep each original column and append its result with _scaled added to the name. When cleared, replace the original values. Default: false.
Scale FAQs
- What happens to missing values?
- NULL values are left out of the statistics and stay NULL in the output. Scaling keeps every row.
- What if all values are the same?
- Min-max returns Output min for each non-NULL value. Standard returns 0. Robust uses a divisor of 1 when the interquartile range is zero. Missing values stay NULL.
- Are statistics calculated separately for each column?
- Yes. Each selected column uses its own non-NULL values across the whole input table.
- What if the separate output column already exists?
- The block reports an error rather than overwriting that column.
Prepare your data. Build it in Strata.
Strata opens in your browser, with no account.