Skip to content

Commit

Permalink
Account for Jeromes' suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelVaroquaux committed Nov 30, 2023
1 parent 65e7106 commit 7b7484c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions skrub/_gap_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ def get_feature_names_out(
label = ", ".join(labels)
# Avoid having twice the same name for the different features
if label in topic_labels:
label += ", {:}".format(i)
label += " ({:})".format(i)
label = prefix + label
topic_labels.append(label)
topic_labels = [prefix + label for label in topic_labels]
return topic_labels

def score(self, X: ArrayLike) -> float:
Expand Down
2 changes: 1 addition & 1 deletion skrub/tests/test_gap_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_get_feature_names_out_no_words():


def test_get_feature_names_out_redundent():
# With the following dataframe, the GapEncoder produces feature names
# With the following dataframe, the GapEncoder can produce feature names
# that have the same name, which leads duplicated features names,
# which themselves lead to errors in the TableVectorizer
# get_feature_names_out() method.
Expand Down

0 comments on commit 7b7484c

Please sign in to comment.