RobustNormalVariate#

class chemotools.scatter.RobustNormalVariate(percentile: float = 25, epsilon: float = 1e-10)[ソース]

ベースクラス: TransformerMixin, OneToOneFeatureMixin, BaseEstimator

A transformer that calculates the robust normal variate of the input data.

パラメータ:
  • percentile (float, optional, default=25) -- The percentile to use for the robust normal variate. The value should be between 0 and 100. The default is 25.

  • epsilon (float, optional, default=1e-10) -- A small value added to the denominator to avoid numerical instability (division by zero). The default is 1e-10.

変数:

n_features_in (int) -- The number of features in the training data.

例外:

UserWarning -- If the standard deviation of the values below the specified percentile is zero, a warning and a small epsilon is added to the denominator to avoid NaNs.

参照

[1] Q. Guo, W. Wu, D.L. Massart.

"The robust normal variate transform for pattern recognition with near-infrared data." doi:10.1016/S0003-2670(98)00737-5

サンプル

>>> from chemotools.datasets import load_fermentation_train
>>> from chemotools.scatter import RobustNormalVariate
>>> # Load sample data
>>> X, _ = load_fermentation_train()
>>> # Initialize RobustNormalVariate
>>> rnv = RobustNormalVariate()
RobustNormalVariate()
>>> # Fit and transform the data
>>> X_scaled = rnv.fit_transform(X)
fit(X: ndarray, y=None) RobustNormalVariate[ソース]

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.

戻り値の型:

RobustNormalVariate

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)