Skip to content

Commit

Permalink
precommit fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-Maladiere committed Nov 9, 2023
1 parent c75c235 commit 29446b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions skrub/_table_vectorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ class TableVectorizer(TransformerMixin, BaseEstimator):
('low_cardinality', OneHotEncoder(drop='if_binary', handle_unknown='ignore', \
sparse_output=False), \
['gender', 'department', 'department_name', 'assignment_category']), \
('high_cardinality', GapEncoder(n_components=30), ['division', 'employee_position_title'])]
('high_cardinality', GapEncoder(n_components=30), \
['division', 'employee_position_title'])]
"""

def __init__(
Expand Down Expand Up @@ -487,7 +488,7 @@ def _auto_cast(self, X):

X = to_datetime(X)
X = to_numeric(X)

# Convert to the best possible data type
self.types_ = {}
for col_idx, col in enumerate(X.columns):
Expand Down Expand Up @@ -535,7 +536,7 @@ def _apply_cast(self, X):
categories=known_categories.union(new_categories)
)
self.types_[col_idx] = dtype

for col_idx, dtype in self.types_.items():
col = X.columns[col_idx]
try:
Expand Down Expand Up @@ -733,7 +734,11 @@ def fit_transform(self, X, y=None):
all_transformers = [
("numeric", self.numerical_transformer_, numeric_columns),
("datetime", self.datetime_transformer_, datetime_columns),
("low_cardinality", self.low_cardinality_transformer_, low_cardinality_columns),
(
"low_cardinality",
self.low_cardinality_transformer_,
low_cardinality_columns,
),
(
"high_cardinality",
self.high_cardinality_transformer_,
Expand Down

0 comments on commit 29446b3

Please sign in to comment.