"Toward Talent Scientist: Sharing and Learning Together" --- Jingwei Too
- This toolbox contains 4 filter feature selection methods
- The
A_Main
file shows the example of how to use these filter feature selection on the benchmark dataset
The main function jffs
is employed to perform feature selection. You may switch the method by changing the 'rf'
to other abbreviations
- If you wish to use Relief-F ( RF ) then you may write
FS = jffs('rf',feat,label,opts);
feat
: feature vector matrix ( Instance x Features )label
: label matrix ( Instance x 1 )opts
: parameter settingsNf
: number of selected features ( must be set for all methods )
Acc
: accuracy of validation modelFS
: feature selection model ( It contains several results )sf
: index of selected featuresff
: selected featuresnf
: number of selected featuress
: weight / scoret
: computational time (s)
% Parameters
opts.K = 3; % number of nearest neighbors
opts.Nf = 10; % select 10 features
% Load dataset
load ionosphere.mat;
% Perform feature selection
FS = jffs('rf',feat,label,opts);
% Define index of selected features
sf_idx = FS.sf;
% Accuracy
kfold = 5;
Acc = mSVM(feat(:,sf_idx),label,kfold);
- MATLAB 2016 or above
- Statistics and Machine Learning Toolbox
- The extra parameter represent the parameter other than number of selected features
- Note : Relief-F contains extra parameter to be adjusted. If you do not set the parameter then the algorithm will be executed using default setting
- You can use
opts
to set the parameterK
: number of nearest neighbors
No. | Abbreviation | Name | Extra Parameter |
---|---|---|---|
4 | 'nca' |
Neighborhood Component Analysis | - |
3 | 'rf' |
Relief-F | opts.K = 5 |
2 | 'tv' |
Term Variance | - |
1 | 'pcc' |
Pearson Correlation Coefficient | - |