Skip to content

Add class method to learner object for retrieving feature names #714

@remo-help

Description

@remo-help

Learners with a selector potentially have a smaller feature name size than is stored in the feature_vectorizer. A simple method accessing the actual used feature names for a learner with or without a selector would be useful

def get_feature_names(self): if self.feat_selector: return self.feat_vectorizer.get_feature_names_out()[self.feat_selector.get_support()] else: return self.feat_vectorizer.get_feature_names_out() 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions