Home Implementing recursive feature elimination in Matlab
Reply: 1

Implementing recursive feature elimination in Matlab

TestGuest Published in 2017-12-07 13:20:08Z

I am implementing a recursive feature elimination (RFE) algorithm in Matlab, and have the following algorithmic question:

Using RFE, I want to plot the number of features used for classification vs. classification accuracy. Now say I have 5 features, I am ranking them based on the weight a linear classifier is giving them (e.g. linear SVM). Which approach is correct:

  1. Rank the features based on the train set k, and from this specific ranking I calculate the accuracy for using n in {1,...,5} features (so 5 calculations of the accuracy based on the ranking of the same train set)


  1. Rank the features based on the train set, calculate the accuracy for a number n features, rank the features again based on the next train set, now calculate the accuracy for the features top n+1 features

It seems to me 1 is correct, because the same train set is used to calculate accuracies for 1,...,5 features, making it somewhat comparable - am I right?

Giorgos Myrianthous
Giorgos Myrianthous Reply to 2017-12-07 14:03:47Z

Features might have different effect on different datasets. Therefore, I would recommend you to implement the first approach that makes use of the same training set since you want to compare some features.

However, I am not sure whether the graph you want to plot makes sense and if it is related to Recursive Feature Elimination. If you want to plot the number of features vs. classification accuracy you need to implement various feature sets and evaluate the model. For instance, if you have 3 features f1, f2 and f3 then you need to produce 7 feature sets;

f1, f2, f3
f1, f2
f1, f3
f2, f3
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312471 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO