Perform sequential feature selection for classification of noisy features - code explanation
1 回表示 (過去 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
0 件のコメント
回答 (2 件)
Sean de Wolski
2011 年 12 月 20 日
doc function_handle
Is possibly be a good starting point to help clarify the above code.
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!