Pipeline doesn't work with Label Encoder
问题 I do as below import pandas as pd from sklearn import preprocessing import sklearn from sklearn.pipeline import Pipeline df = pd.DataFrame({'c':['a', 'b', 'c']*4, 'd': ['m', 'f']*6}) encoding_pipeline =Pipeline([ ('LabelEncoder', preprocessing.LabelEncoder()) ]) encoding_pipeline.fit_transform(df) and full Traceback TypeError Traceback (most recent call last) <ipython-input-7-0882633ccf59> in <module>() ----> 1 encoding_pipeline.fit_transform(df) C:\Program Files\Anaconda3\lib\site-packages