mealy.preprocessing¶
Classes¶
- class mealy.preprocessing.FeatureNameTransformer(original_features, preprocessed_features)[source]¶
Transformer of feature names and indices.
A FeatureNameTransformer parses an input Pipeline preprocessor and generate a mapping between the input unprocessed feature names/indices and the output preprocessed feature names/indices.
- Parameters
ct_preprocessor (sklearn.compose.ColumnTransformer) – preprocessor.
orig_feats (list) – list of original unpreprocessed feature names, default=None.
- class mealy.preprocessing.PipelinePreprocessor(ct_preprocessor, original_features=None)[source]¶
Transformer of feature values from the original values to preprocessed ones.
A PipelinePreprocessor parses an input Pipeline preprocessor and generate a mapping between the input unprocessed feature values and the output preprocessed feature values.
- Parameters
ct_preprocessor (sklearn.compose.ColumnTransformer) – preprocessing steps.
original_features (list) – list of original unpreprocessed feature names, default=None.
- inverse_transform(preprocessed_x)[source]¶
Invert the preprocessing pipeline and inverse transform feature values.
- Parameters
preprocessed_x (numpy.ndarray or scipy sparse matrix) – preprocessed feature values.
- Returns
feature values without preprocessing.
- Return type
- inverse_transform_feature_id(index)[source]¶
Undo preprocessing of feature name.
Transform the preprocessed feature name at given index back into the original unprocessed feature index.
- is_categorical(index=None, name=None)[source]¶
Check whether an unprocessed feature at a given index or with a given name is categorical.