Skip to content

[python-package] Support feature_names_in_ attribute via sklearn API #6279

@ravwojdyla

Description

@ravwojdyla

Summary

sklearn API supports feature_names_in_ attribute on a fitted model (SLEP007), which remembers the feature names/columns that went into the model.fit method. This can be very useful information, and is a standard worth conforming to. Afaiu right now that information is available in the booster:

est.booster_.feature_name()

It shouldn't be too hard to conform to also expose that information via feature_names_in_ attribute 🙏

Motivation

It would conform to the sklearn API standards, improve usability of LightGBM models, especially when used along with other sklearn models and Pipelines.

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions