Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get feature names from one hot encoder

# You can pass the list with original column names to get_feature_names:
encoder.get_feature_names(['Sex', 'AgeGroup'])

# output
# ['Sex_female', 'Sex_male', 'AgeGroup_0', 'AgeGroup_15',
#  'AgeGroup_30', 'AgeGroup_45', 'AgeGroup_60', 'AgeGroup_75']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #feature #names #hot #encoder
ADD COMMENT
Topic
Name
1+2 =