Test: Test for Feature Engineering
Motivation
Enable feature selection based on permutation importance for sklearn-compatible models.
To ensure this, all feature engineering components must:
Be fully compatible com a API do scikit-learn
Produce deterministic and testable outputs
Preserve feature names and shapes correctly, enabling downstream model interpretability (e.g., permutation importance)
Scope
Implement unit tests for feature engineering wrapper classes to guarantee correct behavior, sklearn compatibility, and safe integration in modeling pipelines.
The tests should validate:
-
Interface compliance (fit, transform, fit_transform)
-
Correct handling of pandas DataFrames and NumPy arrays
-
Preservation or correct transformation of feature names
-
Consistent output shapes and data types
-
Compatibility with sklearn tools (e.g., Pipeline, permutation_importance)
Acceptance Criteria
CategoryEncoderWrapper
FunctionTransformerWrapper
Test: Test for Feature Engineering
Motivation
Enable feature selection based on permutation importance for sklearn-compatible models.
To ensure this, all feature engineering components must:
Be fully compatible com a API do scikit-learn
Produce deterministic and testable outputs
Preserve feature names and shapes correctly, enabling downstream model interpretability (e.g., permutation importance)
Scope
Implement unit tests for feature engineering wrapper classes to guarantee correct behavior, sklearn compatibility, and safe integration in modeling pipelines.
The tests should validate:
Interface compliance (
fit,transform,fit_transform)Correct handling of pandas DataFrames and NumPy arrays
Preservation or correct transformation of feature names
Consistent output shapes and data types
Compatibility with sklearn tools (e.g.,
Pipeline,permutation_importance)Acceptance Criteria
CategoryEncoderWrapper
Correctly implements fit, transform, and fit_transform
Returns output with a consistent shape compatible with sklearn
Preserves or exposes feature names (get_feature_names_out)
Works correctly inside an sklearn.Pipeline
Does not raise errors when used with permutation_importance
FunctionTransformerWrapper
Correctly implements fit, transform, and fit_transform
Applies the transformation function consistently
Preserves index alignment when using pandas DataFrames
Returns output with predictable shape and dtype
Works correctly inside an sklearn.Pipeline
Does not raise errors when used with permutation_importance