[ENH] Enable Grid-Search for TableVectorizer#814
Conversation
TableVectorizer
|
I need to address a small docstring error |
Co-authored-by: Jérôme Dockès <jerome@dockes.org>
|
|
||
| HIGH_CARDINALITY_TRANSFORMER = GapEncoder(n_components=30) | ||
| LOW_CARDINALITY_TRANSFORMER = OneHotEncoder( | ||
| sparse_output=False, |
There was a problem hiding this comment.
we expose the ColumnTransformer's sparse_threshold parameter but with our default transformers the default will always be dense (even if toe onehot encoder yields many zeros)
we could consider
- pointing out in the doc that users need to change the transformers if they want sparse output
- not exposing the
sparse_thresholdand always returning dense data - making the onehot encoder sparse by default
(not in this PR)
| ("datetime", self.datetime_transformer_, datetime_columns), | ||
| ("low_card_cat", self.low_card_cat_transformer_, low_card_cat_columns), | ||
| ("high_card_cat", self.high_card_cat_transformer_, high_card_cat_columns), | ||
| ("low_card_cat", self.low_cardinality_transformer_, low_card_cat_columns), |
There was a problem hiding this comment.
not super important but you could propagate the change 'card_cat' -> 'cardinality' to local variables
along that line it would be nice if we picked one of "numeric" or "numerical" and used it all the time :)
There was a problem hiding this comment.
numeric, since it's shorter?
There was a problem hiding this comment.
sounds good! it's also the choice made by polars.selectors.numeric. pandas select_dtypes uses "number", "category"
|
I guess this one is ready to merge? |
|
I think so! |
|
Very nice. Congratulations! |
What does this PR fix/address?
Apply Gaël's suggestions and the outputs of discussion #796 to make grid-search possible.
What does it change?
None, they are turned into "passthrough" during fit (e.g.high_cardinality_encoder = Nonewill result inhigh_cardinality_encoder_ = passthrough