-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
RFC generalised Pipeline.get_feature_names #6424
Copy link
Copy link
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_namesmay be called with a listinput_featuresas an argument only if all its estimators supportget_feature_nameswith an argument. The initialinput_featuresis transformed iteratively through the estimators.Pipeline.get_feature_namesmay 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_namescall is iteratively modified by downstream transformers'get_feature_names.- To be cautious until we find a use-case otherwise,
get_feature_nameswill not be supported in the case thatget_feature_namesis available before (but not adjacent to) that suffix.
- To be cautious until we find a use-case otherwise,
- Otherwise, a
ValueErroris raised. Or: should the attribute become invisible, as forpredictet al.?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels