glassbox.cleaner.scalers¶
StandardScaler and MinMaxScaler for feature normalization.
StandardScaler
¶
Bases: BaseTransformer
Standardizes features by removing the mean and scaling to unit variance.
Source code in glassbox/cleaner/scalers.py
fit
¶
Compute the mean and standard deviation to be used for later scaling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input array of shape (n_samples, n_features). |
required |
Returns:
| Type | Description |
|---|---|
Self
|
Fitted scaler instance. |
Source code in glassbox/cleaner/scalers.py
transform
¶
Perform standardization by centering and scaling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input array of shape (n_samples, n_features). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Transformed array properly scaled. |
Source code in glassbox/cleaner/scalers.py
MinMaxScaler
¶
Bases: BaseTransformer
Transforms features by scaling each feature to a given range.
Source code in glassbox/cleaner/scalers.py
fit
¶
Compute the minimum and maximum to be used for later scaling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input array of shape (n_samples, n_features). |
required |
Returns:
| Type | Description |
|---|---|
Self
|
Fitted scaler instance. |
Source code in glassbox/cleaner/scalers.py
transform
¶
Scale features of X according to feature range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input array of shape (n_samples, n_features). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Transformed array properly scaled. |