A list with the original column names can be passed to get_feature_names
.
>>> encoder.get_feature_names(['Sex', 'AgeGroup'])
array(['Sex_female', 'Sex_male', 'AgeGroup_0', 'AgeGroup_15',
'AgeGroup_30', 'AgeGroup_45', 'AgeGroup_60', 'AgeGroup_75'],
dtype=object)
- DEPRECATED:
get_feature_names
is deprecated in 1.0 and will be removed in 1.2. Please useget_feature_names_out
instead.
>>> encoder.get_feature_names_out(['Sex', 'AgeGroup'])
array(['Sex_female', 'Sex_male', 'AgeGroup_0', 'AgeGroup_15',
'AgeGroup_30', 'AgeGroup_45', 'AgeGroup_60', 'AgeGroup_75'],
dtype=object)