Solved – Is it possible to extract feature importances from a KNN model

caretk nearest neighbourmachine learningr

For tree-based models, I've used varImp in caret to extract feature importances; however, this doesn't work with KNN. Can someone explain why this is/if this is possible? Thanks!

Best Answer

I don't know of a canned command, but you could always measure how much the mean-squared error (or misclassification rate) increases when a variable is either removed or permuted.

Related Question