Algorithm 1: Recursive feature elimination algorithm |
Input: classification data set D with n features; basic classification algorithm model (such as random forest, logistic regression, etc.); the number of features k () for iteration stop; the number of features eliminated at each step.
-
1
Initial feature set
-
2
Training the basic algorithm model:use the F feature set of the data set D to train the basic algorithm model;
-
3
Calculate feature importance: for each feature in F, calculate its impact on model prediction results according to the training results of the model.
-
4
Recursively delete features: delete the least important step features in F;
-
5
Repeat steps 2 to 4 until the required number of features is reached, i.e., ;
-
6
Preserve the selected features: use the feature set F to train the final model, and output the feature subset F and model.
Output: A feature subset composed of k features.
|