Answers for "get feature names from one hot encoder"

0

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']
Posted by: Guest on June-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language