spectrochempy.autoscale๏
- autoscale(dataset, dim='y', inplace=False)[source]๏
Mean-center and scale to unit variance along a dimension.
This is the classic autoscaling (or z-score / standard-score) operation used before PCA, PLS, and other multivariate analyses.
\[x_{ij}^\prime = \frac{x_{ij} - \bar{x}_j}{s_j}\]where \(\bar{x}_j\) and \(s_j\) are the mean and standard deviation along the chosen dimension.
- Parameters:
- Returns:
NDDatasetโ The autoscaled dataset.
Examples
>>> dataset = scp.read("irdata/nh4.spg") >>> nd = dataset.autoscale(dim="x")