How to use gamultiobj for binary decision variables for features selection?
6 views (last 30 days)
Show older comments
I want to use nsga2 for feature selection, where 1 represent feature is selcted while 0 represent that feature is not selected.
How can i use gamultiobj function for this?
7 Comments
Sam Chak
on 20 Jun 2025
@Nainsi Gupta, In that case, if you provide a small sample of data and describe how you would like a certain feature to be selected, experts in the fields of optimization and operations research can likely recommend appropriate built-in functions to address this problem.
Torsten
on 20 Jun 2025
Edited: Torsten
on 20 Jun 2025
Here are the MATLAB tools for multiobjective optimization. You will have to check by the mathematical description of the problems that can be solved whether the respective solver is suitable for your purpose or not.
Maybe we can help if you include the mathematical formulation of your optimization problem.
Answers (1)
Deepak
on 23 Jun 2025
I understand that you are looking to use NSGA-II via "gamultiobj" function in MATLAB for binary feature selection, where each feature is represented by a 1 (selected) or 0 (not selected). To do this, you can set the option "PopulationType","bitstring" in optimoptions, which tells the solver to treat each individual as a binary vector. In your objective function, use this binary vector as a mask on your dataset to train a classifier (e.g., SVM), and return two objectives — typically classification error and number of selected features.
This approach allows "gamultiobj" to evolve a Pareto front of solutions that balance feature reduction and predictive performance. You can visualize the trade-off using "gaplotpareto", and select the best solution based on your preference. This method is recommended for binary feature selection tasks.
Please find attached the relevant documentations for reference:
Multiobjective Optimization: www.mathworks.com/discovery/multiobjective-optimization.html
gamultiobj: www.mathworks.com/help/gads/gamultiobj.html
I hope this helps.
0 Comments
See Also
Categories
Find more on Multiobjective Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!