0

I have two variables:

numeric_cols = ['FamilyMembers', 'ChronicDiseases']

and I have this pipeline:

numeric_transformer = Pipeline(
                        steps=[('scaler', StandardScaler(),
                                'red_dim', PCA())
])

and I get the error:

ValueError: too many values to unpack (expected 2)

I get the same error with 4 variables.

How can I fix this error?

rnv86
  • 790
  • 4
  • 10
  • 22

1 Answers1

1

Pipeline's steps should be a list of (name, transform) tuples as follows:

numeric_transformer = Pipeline(
                        steps=[('scaler', StandardScaler()),
                                ('red_dim', PCA())
                              ]
)
Antoine Dubuis
  • 4,974
  • 1
  • 15
  • 29