All problems
Permutation Importance Rank
Problem
Rank features by mean permutation importance. Average each column of the matrix across repeats, then return feature indices ordered by descending mean, breaking ties by the smaller index. Empty input returns [].
Hint
Averaging over repeats makes the ranking less sensitive to a single unlucky shuffle.
Test cases
case 1
in: [[[0.1,0.4,0.2],[0.2,0.5,0.3]]]
expected: [1,2,0]
case 2
in: [[[0.5,0.5,0.1]]]
expected: [0,1,2]
case 3
in: [[[1,2],[2,1]]]
expected: [0,1]
case 4
in: [[]]
expected: []
case 5
in: [[[],[]]]
expected: []
Starter codePython
def permutation_importance_rank(importance_matrix):
# Your code here
pass5 test cases · run your code against them in the editor