How to do Onehotencoding in Sklearn Pipeline
问题 I am trying to oneHotEncode the categorical variables of my Pandas dataframe, which includes both categorical and continues variables. I realise this can be done easily with the pandas .get_dummies() function, but I need to use a pipeline so I can generate a PMML-file later on. This is the code to create a mapper. The categorical variables I would like to encode are stored in a list called 'dummies'. from sklearn_pandas import DataFrameMapper from sklearn.preprocessing import OneHotEncoder