1
$\begingroup$

I want to measure the feature importance of a series of models after training them. Most models have some built-in APIs that allow me to access their feature importance, but as far as I know, these are stricted to that specific type of model, and is not comparable with importance metrics from other models.

I did some reseach myself and found this paper; The Berkelmans-Pries Feature Importance Method: A Generic Measure of Informativeness of Features. It is relatively new so I am not sure if it is robust/stable.

Are there any older methods that are more well-known in the field?

$\endgroup$

1 Answer 1

1
$\begingroup$

Permutation importance is a relatively simply model-agnostic approach. You train and score a model the usual way to get a reference score. Then you take each feature in turn, and score the model after shuffling the feature. If performance drops compared to the reference score, then it denotes a degree of importance to the shuffled feature.

Correlated features get missed or under-estimated using this method, so you'd usually need to handle that beforehand by combining or dropping correlated features.

There's an example I've previously coded up here, and sklearn has some good examples: 1, 2.

$\endgroup$
7
  • $\begingroup$ Hello Muhammed, thank you for your reference. I have tried sklearn's permutation importance before and somehow most of my features have exactly 0, 0.1 or 0.2 importance. I was confused and thought maybe this method does not fit my model that well. Would you say this is a concidence? $\endgroup$
    – Yuuya
    Commented May 16 at 4:29
  • $\begingroup$ Are those results when you run permutation tests on the same data used for training? In general, I'd fit the model on the training data and then run the permutation tests on unseen validation data. Also, if there are correlated features, that can end up making features look less important, so it's worth checking feature correlations beforehand. If you are able to upload or email some data I could take a look. $\endgroup$ Commented May 16 at 8:16
  • $\begingroup$ The permutation result was based on my test set and model trained by training set. I am aware there are several features related to each other, but since they are not exactly the same and do capture special information, I chose to keep them. Plus I found the model performance dropped if I removed some of them. Unfortunately I cannot share the data because they are confidential. $\endgroup$
    – Yuuya
    Commented May 16 at 10:21
  • $\begingroup$ Does the model perform reasonably well with unpermuted features? The rationale for keeping features sounds sensible and I think it applies in general. For the purposes of permutation testing specifically, I think it could still be worth checking correlations. The aim is to assess importances given the limitations of the test, for which a mediocre/decent model with loosely-correlated features might be more informative. About the exact values you're observing - it might help to run lots of permutation trials per feature and look at averages using a box plot. $\endgroup$ Commented May 16 at 11:04
  • 1
    $\begingroup$ you are probably right, let me see if i can modify the features a little bit, thank you $\endgroup$
    – Yuuya
    Commented Jun 7 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.