StandardNormalVariate#
- class chemotools.scatter.StandardNormalVariate[ソース]
ベースクラス:
TransformerMixin,OneToOneFeatureMixin,BaseEstimatorA transformer that calculates the standard normal variate of the input data.
- 変数:
n_features_in (int) -- The number of features in the training data.
- 例外:
UserWarning -- If the standard deviation of a spectrum is zero (spectrum is flat), a warning is raised indicating that the result will contain NaNs.
参照
- [1] Åsmund Rinnan, Frans van den Berg, Søren Balling Engelsen,
"Review of the most common pre-processing techniques for near-infrared spectra," TrAC Trends in Analytical Chemistry 28 (10) 1201-1222 (2009).
サンプル
>>> from chemotools.datasets import load_fermentation_train >>> from chemotools.scatter import StandardNormalVariate >>> # Load sample data >>> X, _ = load_fermentation_train() >>> # Initialize StandardNormalVariate >>> snv = StandardNormalVariate() StandardNormalVariate() >>> # Fit and transform the data >>> X_scaled = snv.fit_transform(X)
- fit(X: ndarray, y=None) StandardNormalVariate[ソース]
Fit the transformer to the input data.
- パラメータ:
X (np.ndarray of shape (n_samples, n_features)) -- The input data to fit the transformer to.
y (None) -- Ignored to align with API.
- 戻り値:
self -- The fitted transformer.
- 戻り値の型:
StandardNormalVariate
- transform(X: ndarray, y=None) ndarray[ソース]
Transform the input data by calculating the standard normal variate.
- パラメータ:
X (np.ndarray of shape (n_samples, n_features)) -- The input data to transform.
y (None) -- Ignored to align with API.
- 戻り値:
X_transformed -- The transformed data.
- 戻り値の型:
np.ndarray of shape (n_samples, n_features)