Preprocessing
AbstractNormalization
Bases: OneToOneFeatureMixin
, TransformerMixin
, BaseEstimator
Abstract base class for normalization techniques. All normalization classes
should inherit from this class and implement the transform
and inverse_transform
methods.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the normalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
AbstractNormalization |
AbstractNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the input data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
transform(X)
Transform the input data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
BoxCoxNormalization
Bases: AbstractNormalization
Normalization using Box-Cox transformation.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the Box-Cox transformer to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
BoxCoxNormalization |
BoxCoxNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using Box-Cox transformation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
DummyNormalization
Bases: AbstractNormalization
Normalization that does not change the data.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the DummyNormalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
DummyNormalization |
DummyNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data (no change).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
transform(X)
Transform the input data (no change).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
InvSigmoidNormalization
Bases: AbstractNormalization
Normalization using inverse sigmoid scaling.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the InvSigmoidNormalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
InvSigmoidNormalization |
InvSigmoidNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using inverse sigmoid scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
LogNormalization
Bases: AbstractNormalization
Normalization using logarithmic scaling.
Source code in asf/preprocessing/performace_scaling.py
__init__(base=10, eps=1e-06)
Initialize LogNormalization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base
|
float
|
Base of the logarithm. Defaults to 10. |
10
|
eps
|
float
|
Small constant to avoid log(0). Defaults to 1e-6. |
1e-06
|
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the LogNormalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
LogNormalization |
LogNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using logarithmic scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
MinMaxNormalization
Bases: AbstractNormalization
Normalization using Min-Max scaling.
Source code in asf/preprocessing/performace_scaling.py
__init__(feature_range=(0, 1))
Initialize MinMaxNormalization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_range
|
tuple[float, float]
|
Desired range of transformed data. Defaults to (0, 1). |
(0, 1)
|
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the Min-Max scaler to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
MinMaxNormalization |
MinMaxNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using Min-Max scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
NegExpNormalization
Bases: AbstractNormalization
Normalization using negative exponential scaling.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the NegExpNormalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
NegExpNormalization |
NegExpNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using negative exponential scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
SqrtNormalization
Bases: AbstractNormalization
Normalization using square root scaling.
Source code in asf/preprocessing/performace_scaling.py
__init__(eps=1e-06)
Initialize SqrtNormalization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eps
|
float
|
Small constant to avoid sqrt(0). Defaults to 1e-6. |
1e-06
|
fit(X, y=None, sample_weight=None)
Fit the SqrtNormalization model to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SqrtNormalization |
SqrtNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using square root scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
ZScoreNormalization
Bases: AbstractNormalization
Normalization using Z-Score scaling.
Source code in asf/preprocessing/performace_scaling.py
fit(X, y=None, sample_weight=None)
Fit the Z-Score scaler to the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
y
|
ndarray
|
Target values. Defaults to None. |
None
|
sample_weight
|
ndarray
|
Sample weights. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ZScoreNormalization |
ZScoreNormalization
|
The fitted normalization instance. |
Source code in asf/preprocessing/performace_scaling.py
inverse_transform(X)
Inverse transform the data back to the original scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Transformed data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Original data. |
Source code in asf/preprocessing/performace_scaling.py
transform(X)
Transform the input data using Z-Score scaling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Input data. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Transformed data. |
Source code in asf/preprocessing/performace_scaling.py
get_default_preprocessor(categorical_features=None, numerical_features=None)
Creates a default preprocessor for handling categorical and numerical features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
categorical_features
|
Optional[Union[List[str], Callable]]
|
List of categorical feature names or a callable selector. Defaults to selecting object dtype columns. |
None
|
numerical_features
|
Optional[Union[List[str], Callable]]
|
List of numerical feature names or a callable selector. Defaults to selecting numeric dtype columns. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ColumnTransformer |
ColumnTransformer
|
A transformer that applies preprocessing pipelines to categorical and numerical features. |