Interactive Normalization Calculator
Try Change Sensor reading: from 25 to 0.
Observe Compare Min-Max, Z-Score, Robust, and Log Transform results for sensor reading 0.
Explain Explain why Log Transform requires a sensor reading greater than 0.
Calculate
Reset
Technical boundaries. The formulas use the supplied range, population mean, standard deviation, median, and IQR. Equal range bounds return 0.5 for Min-Max; Log Transform requires a positive value.
Interactive Normalization Calculator
Try different sensor values and see how each normalization method transforms them:
viewof normSensorValue = Inputs. range ([0 , 100 ], {
value : 25 , step : 0.1 , label : "Sensor reading:"
})
viewof normMinRange = Inputs. range ([- 50 , 100 ], {
value : 0 , step : 1 , label : "Sensor min range:"
})
viewof normMaxRange = Inputs. range ([0 , 200 ], {
value : 50 , step : 1 , label : "Sensor max range:"
})
viewof normMean = Inputs. range ([- 50 , 150 ], {
value : 25 , step : 0.1 , label : "Population mean (μ):"
})
viewof normStdDev = Inputs. range ([0.1 , 50 ], {
value : 10 , step : 0.1 , label : "Std deviation (σ):"
})
viewof normMedian = Inputs. range ([- 50 , 150 ], {
value : 25 , step : 0.1 , label : "Median:"
})
viewof normIQR = Inputs. range ([0.1 , 50 ], {
value : 15 , step : 0.1 , label : "IQR (Q3 - Q1):"
})
{
const value = normSensorValue;
const minR = normMinRange;
const maxR = normMaxRange;
const mu = normMean;
const sigma = normStdDev;
const median = normMedian;
const iqr = normIQR;
const minMax = maxR === minR ? 0.5 : (value - minR) / (maxR - minR);
const zScore = sigma === 0 ? 0 : (value - mu) / sigma;
const robust = iqr === 0 ? 0 : (value - median) / iqr;
const logVal = value > 0 ? Math . log (value) : "N/A (value must be > 0)" ;
return html `<div style="background: var(--bs-light, #f8f9fa); padding: 1.2rem; border-radius: 8px; border-left: 4px solid #16A085; color: var(--bs-body-color);">
<h4 style="margin-top: 0; color: #2C3E50;">Normalization Results for value = ${ value. toFixed (1 )} </h4>
<table style="width: 100%; border-collapse: collapse; color: var(--bs-body-color);">
<thead>
<tr style="border-bottom: 2px solid #16A085;">
<th style="text-align: left; padding: 6px;">Method</th>
<th style="text-align: left; padding: 6px;">Formula</th>
<th style="text-align: right; padding: 6px;">Result</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px; font-weight: bold;">Min-Max</td>
<td style="padding: 6px;">( ${ value. toFixed (1 )} - ${ minR} ) / ( ${ maxR} - ${ minR} )</td>
<td style="padding: 6px; text-align: right; font-family: monospace; font-weight: bold; color: #16A085;"> ${ minMax. toFixed (4 )} </td>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px; font-weight: bold;">Z-Score</td>
<td style="padding: 6px;">( ${ value. toFixed (1 )} - ${ mu. toFixed (1 )} ) / ${ sigma. toFixed (1 )} </td>
<td style="padding: 6px; text-align: right; font-family: monospace; font-weight: bold; color: #E67E22;"> ${ zScore. toFixed (4 )} </td>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px; font-weight: bold;">Robust</td>
<td style="padding: 6px;">( ${ value. toFixed (1 )} - ${ median. toFixed (1 )} ) / ${ iqr. toFixed (1 )} </td>
<td style="padding: 6px; text-align: right; font-family: monospace; font-weight: bold; color: #3498DB;"> ${ robust. toFixed (4 )} </td>
</tr>
<tr>
<td style="padding: 6px; font-weight: bold;">Log Transform</td>
<td style="padding: 6px;">ln( ${ value. toFixed (1 )} )</td>
<td style="padding: 6px; text-align: right; font-family: monospace; font-weight: bold; color: #9B59B6;"> ${ typeof logVal === "number" ? logVal. toFixed (4 ) : logVal} </td>
</tr>
</tbody>
</table>
<p style="margin-top: 0.8rem; margin-bottom: 0; font-size: 0.9em; opacity: 0.8;">
${ minMax < 0 || minMax > 1 ? "Min-Max result is outside [0,1] — the reading is outside the specified range." : "Min-Max result is within the expected [0,1] range." }
${ Math . abs (zScore) > 3 ? "Z-Score exceeds ±3σ — this reading would be flagged as an outlier." : "" }
</p>
</div>` ;
}
Back to the chapter