File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,24 @@ def _create_estimator(self):
640
640
641
641
return estimator , default_param_grid
642
642
643
+ def get_feature_names_out (self ):
644
+ """
645
+ Return the names of the actual features used by the estimator.
646
+
647
+ It is possible for some features to get filtered out by the
648
+ feature selector which means that the vectorizer is no
649
+ longer the correct source for the feature names. This
650
+ method takes into account the feature selector and returns
651
+ the names of the features that were actually selected to be
652
+ used by the estimator.
653
+
654
+ Returns
655
+ -------
656
+ names : 1-D array
657
+ Names of features actually used by the estimator.
658
+ """
659
+ return self .feat_vectorizer .get_feature_names_out ()[self .feat_selector .get_support ()]
660
+
643
661
def _check_input_formatting (self , examples ):
644
662
"""
645
663
check that the examples are properly formatted.
You can’t perform that action at this time.
0 commit comments