You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest 1.2 release is full of great features, e.g., full column name support. This brings me to one of my most desired features regarding building strong and realistic linear models: Interactions!
It is currently very hard to add interaction terms between two feature groups, especially if they involve 1 to m transforms like OHE or SplineTransformers.
Describe your proposed solution
An idea of @lorentzenchr that I try to summarize: Create the transforms like a ColumnTransformer, but also adding interaction terms between columns generated by each transformer. The resulting columns could be glued to an other ColumnTransformer using FeatureUnion.
Sketch of the API
InteractionTransformer(
transformers,
interaction_only=False
include_bias=True,
verbose_feature_names_out=True
)
# transformers: list of tuples
# List of (name, transformer, columns) tuples specifying the transformer objects to be applied to subsets of the data.
# Each transformer would specify a feature (group) that would interact with other transformers.
# interaction_only: If False, also return main effects
Example 1: Interactions between two 1-m transforms
Here, we would let each dummy variable of "f1" interact with each spline basis of "f2":
How would this design interact with hyper-parameter tuning? We should try to craft a design that will lead to a nice UX assuming we move forward with #21784.
Uh oh!
There was an error while loading. Please reload this page.
Describe the workflow you want to enable
The latest 1.2 release is full of great features, e.g., full column name support. This brings me to one of my most desired features regarding building strong and realistic linear models: Interactions!
It is currently very hard to add interaction terms between two feature groups, especially if they involve 1 to m transforms like OHE or SplineTransformers.
Describe your proposed solution
An idea of @lorentzenchr that I try to summarize: Create the transforms like a ColumnTransformer, but also adding interaction terms between columns generated by each transformer. The resulting columns could be glued to an other ColumnTransformer using
FeatureUnion
.Sketch of the API
Example 1: Interactions between two 1-m transforms
Here, we would let each dummy variable of "f1" interact with each spline basis of "f2":
Example 2: Interaction between OHE and other features
Each column generated by OHE "f1" would interact with numeric feature "f2" and also with numeric feature "f3".
Example 3: Interaction between two OHE, further features linear
Describe alternatives you've considered, if relevant
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: