Filter-Feature-Selection-Toolbox
Filter-Feature-Selection-Toolbox copied to clipboard
Simple, fast and ease of implementation. The filter feature selection methods include Relief-F, PCC, TV, and NCA.
trafficstars
Jx-FFST : A Filter Feature Selection Toolbox
"Toward Talent Scientist: Sharing and Learning Together" --- Jingwei Too
Introduction
- This toolbox contains 4 filter feature selection methods
- The
A_Mainfile shows the example of how to use these filter feature selection on the benchmark dataset
Usage
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);
Input
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 )
Output
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)
Example : Relief-F ( RF )
% 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);
Requirement
- MATLAB 2016 or above
- Statistics and Machine Learning Toolbox
List of available filter feature selection methods
- 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
optsto 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 | - |