Skip to content

Commit

Permalink
Merge pull request #291 from pobonomo/1.4.x
Browse files Browse the repository at this point in the history
Deal with empty list of column in column transformer
  • Loading branch information
pobonomo authored Mar 4, 2024
2 parents 51fa48f + b3cd093 commit 74efb64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gurobi_ml/sklearn/column_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def _mip_model(self, **kwargs):
transformers = {k.lower(): v for k, v in sklearn_transformers().items()}
transformed = []
for name, trans, cols in column_transform.transformers_:
if len(cols) == 0:
# If there are no columns to transform nothing to do
continue
if trans == "passthrough":
if isinstance(cols, str) or isinstance(cols[0], str):
transformed.append(_input.loc[:, cols])
Expand Down

0 comments on commit 74efb64

Please sign in to comment.