RobustNormalVariate#
- class chemotools.scatter.RobustNormalVariate(percentile: float = 25, epsilon: float = 1e-10)[fuente]
Bases:
TransformerMixin,OneToOneFeatureMixin,BaseEstimatorA transformer that calculates the robust normal variate of the input data.
- Parámetros:
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.
- Variables:
n_features_in (int) – The number of features in the training data.
- Muestra:
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.
Referencias
- [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
Ejemplos
>>> 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[fuente]
Fit the transformer to the input data.
- Parámetros:
X (np.ndarray of shape (n_samples, n_features)) – The input data to fit the transformer to.
y (None) – Ignored to align with API.
- Devuelve:
self – The fitted transformer.
- Tipo del valor devuelto:
RobustNormalVariate
- transform(X: ndarray, y=None) ndarray[fuente]
Transform the input data by calculating the standard normal variate.
- Parámetros:
X (np.ndarray of shape (n_samples, n_features)) – The input data to transform.
y (None) – Ignored to align with API.
- Devuelve:
X_transformed – The transformed data.
- Tipo del valor devuelto:
np.ndarray of shape (n_samples, n_features)