-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapper feature selection method using MLP models #1
Comments
I am using ANN, LSTM, CNN models for classification. Now I want to apply the wrapper method for feature selection. I need python code for that. Can anyone help me, please? |
#importing the necessary libraries Sequential Forward Selection(sfs)sfs = SFS(LinearRegression(), sfs.fit(x, y) I got this code for using the wrapper method in LR model. How I input my ANN or LSTM or CNN model for wrapper feature selection I can't understand. Can anyone help me, please? |
There are several wrapper methods for feature selection in Python, such as Recursive Feature Elimination (RFE), Sequential Backward Selection (SBS), and Genetic Algorithm (GA). Here is an example of how to use RFE with a LSTM model for classification in Python:
This code will train an LSTM model using the RFE wrapper method, and select the top 10 features based on the model's performance. You can adjust the n_features_to_select parameter to select a different number of features, and the input_shape parameter to match the shape of your input data. You can also apply the wrapper method for feature selection for other models like ANN and CNN, you just need to change the architecture of the model in the create_model function. |
No description provided.
The text was updated successfully, but these errors were encountered: