spectrochempy.robust_scale๏
- robust_scale(dataset, dim='y', inplace=False)[source]๏
Apply robust scaling along a dimension.
The data are centered on the median and scaled by the median absolute deviation (MAD). This makes the scaling resistant to outliers.
\[x_{ij}^\prime = \frac{x_{ij} - \mathrm{median}(x_j)}{\mathrm{MAD}(x_j)}\]where \(\mathrm{MAD} = \mathrm{median}(|x - \mathrm{median}|)\) and the result is multiplied by 1.4826 so that the MAD estimates the standard deviation of a normal distribution.
- Parameters:
- Returns:
NDDatasetโ The robustly-scaled dataset.
Examples
>>> dataset = scp.read("irdata/nh4y-activation.spg") >>> nd = dataset.robust_scale(dim="y")