JuliaAI / MLJBase.jl

Core functionality for the MLJ machine learning framework
MIT License
160 stars 45 forks source link

Allow `Pipeline` and `TransformedTargetModel` to support feature importances #963

Closed ablaom closed 6 months ago

ablaom commented 6 months ago

A model that supports features importances exposes these via the method feature_importances. However, these importances are hidden if the model is wrapped in TransformedTargetModel or is part of a pipeline. This PR implements feature_importances (and the trait reports_feature_importances) for these two wrappers by forwarding the atomic methods.

For testing purposes, the test model DecisionTreeClassifier in /test/_models/DecisionTree.jl has been updated to support feature importances.

@OkonSamuel

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.07%. Comparing base (44ca101) to head (059703a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #963 +/- ## ========================================== + Coverage 88.01% 88.07% +0.05% ========================================== Files 28 28 Lines 2554 2565 +11 ========================================== + Hits 2248 2259 +11 Misses 306 306 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.