Permutation importance asks a simple question: if you scrambled one feature and left everything else alone, how much worse do the predictions get? The mechanics are almost all in how the randomness is drawn, and a one-character mistake there makes every repeat identical to the last.
Write permutation_importance(predict_fn, X, y, feature_index, n_repeats, seed).
predict_fn(X) compared against y, on the unmodified data.rng = np.random.default_rng(seed).n_repeats times: make a copy of X, shuffle only column feature_index using a fresh permutation drawn from rng, and compute the accuracy of predict_fn on the shuffled copy.baseline − shuffled_accuracy.Return (mean_importance, std_importance) across the n_repeats values, as plain floats.
rng must be created once and reused across every repeat. Re-seeding a fresh generator inside the loop draws the identical permutation every time, which turns "averaged over n_repeats independent shuffles" into "the same single shuffle, counted n_repeats times" — silently.
Build the architecture on a canvas: place the components, configure them, connect them into a data flow, and write a short reason for each one. The AI reviewer grades your design against a rubric written specifically for this problem.
Minimum 5 components · needs a wide desktop screen