Skip to content

Commit

Permalink
FIX correction of building a list instead of squeezing when index is …
Browse files Browse the repository at this point in the history
…built from 1 element
  • Loading branch information
dantegd committed Feb 7, 2024
1 parent 287e8d4 commit 4d64ea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/cuml/preprocessing/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def inverse_transform(self, X):
dropped_class_idx = Series(self.drop_idx_[feature])
dropped_class_mask = Series(cats).isin(cats[dropped_class_idx])
if len(cats) == 1:
inv = Series(Index(cp.squeeze(cats[0])).repeat(X.shape[0]))
inv = Series(Index([cats[0]]).repeat(X.shape[0]))
result[feature] = inv
continue
cats = cats[~dropped_class_mask]
Expand Down

0 comments on commit 4d64ea8

Please sign in to comment.