Feature Importance for KNN regression KNeighborsRegressor() #28304
Replies: 2 comments 1 reply
-
|
You can have a look at the permutation importance that is an mode agnostic approach: https://scikit-learn.org/stable/modules/permutation_importance.html |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I'm a new contributor and I'm interested in helping with this. Following the discussion here, it seems the recommended solution is to use permutation_importance. I would like to propose adding a new method to KNeighborsRegressor, something like model.compute_feature_importance(X, y), which would act as a convenient wrapper for the permutation_importance function. This would improve usability, as users wouldn't need to import and call permutation_importance manually. Does this sound like a good approach? If so, I'd be happy to start working on a PR cc: @ogrisel, @glemaitre |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I can't find any solution for plotting feature importance for KNeighborsRegressor(). I tried yellowbrick library as follows but it didn't work:
from yellowbrick.model_selection import FeatureImportances
gives this error:
could not find feature importances param on KNeighborsRegressor
Beta Was this translation helpful? Give feedback.
All reactions