Skip to content

Enhancement: Add get_feature_importance() to AutoML #812

Open
MossabArektout wants to merge 1 commit into
mljar:masterfrom
MossabArektout:enhancement/automl-feature-importance
Open

Enhancement: Add get_feature_importance() to AutoML #812
MossabArektout wants to merge 1 commit into
mljar:masterfrom
MossabArektout:enhancement/automl-feature-importance

Conversation

@MossabArektout

@MossabArektout MossabArektout commented May 9, 2026

Copy link
Copy Markdown

Resolves #809

Summary

Adds a public API to retrieve feature importance directly from AutoML:

  • automl.get_feature_importance(model="best", kind="raw")
  • Supports:
    • model="best" (default)
    • model="all"
    • specific model name
  • Supports:
    • kind="raw"
    • kind="normalized" (per-model min-max normalization)

What Changed

  • Added AutoML.get_feature_importance(...) in supervised/automl.py.
  • Implemented backend logic in BaseAutoML:
    • load and aggregate feature importance from existing *_importance.csv files,
    • return empty DataFrame for models without available importance.
  • Added best-effort recompute when importance files are missing:
    • recompute uses permutation importance generation for model learners,
    • if recompute still cannot produce valid importance, returns empty output (no exception).
  • Added tests for API behavior in:
    • tests/tests_automl/test_feature_importance_api.py

Notes

  • Normalized importance uses per-model min-max scaling to [0, 1].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add get_feature_importance() to AutoML

1 participant