[MRG] Fixes get_feature_names results when using drop functionality
@@ -851,6 +851,8 @@ class OneHotEncoder(_BaseEncoder):
for i in range(len(cats)):
names = [
input_features[i] + '_' + str(t) for t in cats[i]]
+ if self.drop is not None:
+ names.pop(self.drop_idx_[i])
feature_names.extend(names)
return np.array(feature_names, dtype=object)
