Hello!
I was following your transformation step implementation and I am having some issues with the output. Applying the encoders as the second step of the pipeline makes it return the features that are affected by the scaler. In your case it would be ["trip_distance", "trip_duration"].
def transformer_fn():
"""
Returns an *unfitted* transformer that defines ``fit()`` and ``transform()`` methods.
The transformer's input and output signatures should be compatible with scikit-learn
transformers.
"""
function_transformer_params = (
{}
if sklearn.__version__.startswith("1.0")
else {"feature_names_out": "one-to-one"}
)
return Pipeline(
steps=[
(
"calculate_features",
FunctionTransformer(calculate_features, **function_transformer_params),
),
(
"encoder",
ColumnTransformer(
transformers=[
(
"robust_scaler",
RobustScaler(),
["competition_distance", "competition_time_month"],
),
(
"min_max_scaler",
MinMaxScaler(),
["promo_time_week"],
)
]
),
),
]
)
This is my transformer_fn and this is what I am getting:

How do you combine the transformed features with the dataset pre-transformed? What am I missing?
Thank you :)
Hello!
I was following your transformation step implementation and I am having some issues with the output. Applying the encoders as the second step of the pipeline makes it return the features that are affected by the scaler. In your case it would be ["trip_distance", "trip_duration"].
This is my
transformer_fnand this is what I am getting:How do you combine the transformed features with the dataset pre-transformed? What am I missing?
Thank you :)