Perform sequential feature selection for classification of noisy features - code explanation

2 次查看(过去 30 天)
Dear All, First of all I'm new to use matlab software, I'm very interested with feature selection method (sequential method) to get discriminant variable in the end. I've searched and learn from matlab it self about the example but I little bit confused about these part
*fun = @(XT,yT,Xt,yt)... (sum(~strcmp(yt,classify(Xt,XT,yT,'quadratic'))));
[fs,history] = sequentialfs(fun,X,y,'cv',c,'options',opts) *
can anybody teach me how the function worked until it get for example this value (Step 1, added column 7, criterion value 0.04)
Thanks a lot! Best Regards Adrian Tjahjana
example:
load fisheriris; X = randn(150,10); X(:,[1 3 5 7 ])= meas; y = species;
c = cvpartition(y,'k',10); opts = statset('display','iter'); fun = @(XT,yT,Xt,yt)... (sum(~strcmp(yt,classify(Xt,XT,yT,'quadratic'))));
[fs,history] = sequentialfs(fun,X,y,'cv',c,'options',opts)
Start forward sequential feature selection: Initial columns included: none Columns that can not be included: none Step 1, added column 7, criterion value 0.04 Step 2, added column 5, criterion value 0.0266667 Final columns included: 5 7
fs = 0 0 0 0 1 0 1 0 0 0 history = In: [2x10 logical] Crit: [0.0400 0.0267]
history.In ans = 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0

回答(2 个)

Sean de Wolski
Sean de Wolski 2011-12-20
doc function_handle
Is possibly be a good starting point to help clarify the above code.
  1 个评论
Adrian
Adrian 2011-12-21
HI Thanks for the reply, it's really helpful
more question, it's a book or something else that I can deeply learn matlab code about feature selection?
Thanks

请先登录,再进行评论。


Richard Willey
Richard Willey 2011-12-22
Hi Adrian
I did a two part series on Loren Shure's blog contrasting feature selection techniques with regularization. The article contain some background theory along with some example code. You can read the articles at
I also did a recorded webinar that dives into more detail on these topics. You can watch the webinar at http://www.mathworks.com/company/events/webinars/wbnr59911.html?seq=1 or download the code from http://www.mathworks.com/matlabcentral/fileexchange/33329
If you want a more thorough treatment of the underlying theory your best option is probably to get a copy of "Elements of Statistical Learning" by Hastie, Tibshirani, and Friedman.
Please note: If you're primary interested in information about how to use feature selection in MATLAB then your best course of action is to (thoroughly) read up on function handles and anonymous functions. (This is the most likely stumbling block)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by