-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Closed
Description
There has been some demand for Pipeline.get_feature_names
(#2007, #5172, #6421) for the case where the last element in the pipeline is a feature extractor. Following on from #6372, we instead shall make get_feature_names
able to transform some list of input features in the general case. I propose the following behaviour:
Pipeline.get_feature_names
may be called with a listinput_features
as an argument only if all its estimators supportget_feature_names
with an argument. The initialinput_features
is transformed iteratively through the estimators.Pipeline.get_feature_names
may be called without an argument only if a suffix of its estimators supportget_feature_names
. The first of that suffix may or may not acceptinput_features
, and the remainder must acceptinput_features
; the output of the firstget_feature_names
call is iteratively modified by downstream transformers'get_feature_names
.- To be cautious until we find a use-case otherwise,
get_feature_names
will not be supported in the case thatget_feature_names
is available before (but not adjacent to) that suffix.
- To be cautious until we find a use-case otherwise,
- Otherwise, a
ValueError
is raised. Or: should the attribute become invisible, as forpredict
et al.?
armgilles, wiseyoungbuck, amueller, JoshuaGhost, hermidalc and 8 more
Metadata
Metadata
Assignees
Labels
No labels