Closed
Description
Description
To me this looks like a really simple fix:
At line https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/compose/_column_transformer.py#L364
the get_feature_names function in column_transformer assumes all the transformers will provide elements of type string. I think the fix could be something as simple as rewriting the code to be.
feature_names.extend([name + "__" + str(f) for f in trans.get_feature_names()])
ie f has str wrapped around it.
Not all sklearn components such as the DictVectorizer guarantee the elements of get_feature_names() will be strings so this seems like a good addition.