get feature names from one hot encoder

Solutions on MaxInterview for get feature names from one hot encoder by the best coders in the world

showing results for - "get feature names from one hot encoder"
Lotta
19 Jan 2021
1# You can pass the list with original column names to get_feature_names:
2encoder.get_feature_names(['Sex', 'AgeGroup'])
3
4# output
5# ['Sex_female', 'Sex_male', 'AgeGroup_0', 'AgeGroup_15',
6#  'AgeGroup_30', 'AgeGroup_45', 'AgeGroup_60', 'AgeGroup_75']
similar questions
queries leading to this page
get feature names from one hot encoder