Feature Selection for Machine
Learning by Black-Box Optimization¶
Introduction¶
The input data fed to a machine learning model consists of many features (the individual attributes
of
each data point). Not all of them are useful for prediction, however, which is why “feature selection”
—
keeping only the features that matter and discarding the rest — is common practice.
Selecting only the features that contribute to prediction yields a lightweight model that achieves
high
prediction accuracy while keeping training and inference computational costs low.
In this tutorial, we perform feature selection on a handwritten digit image classification problem
(MNIST). Each image is represented by 28x28 pixels, or 784 pixels in total (features). Our task is to
decide whether to use each feature and to find the combination of features that yields the best
classification model.
We want classification accuracy to be as high as possible while using as few features as possible.
These
goals pull in opposite directions: using fewer features tends to lower classification accuracy, while
prioritizing accuracy tends to require more features. We therefore need a solution that balances the
two.
Optimization that handles multiple objectives simultaneously is called multi-objective optimization.
The search itself is also demanding. There are far too many combinations of 784 “use” / “do not use”
decisions to try exhaustively, and evaluating even a single combination requires training a
classification
model and measuring its performance, which is time-consuming.
For this reason, this tutorial uses Amplify-BBOpt, a black-box
optimization library well suited to problems of this kind. Amplify-BBOpt is a Python library that
efficiently solves black-box optimization problems by leveraging quantum-inspired technology, and it
excels at high-dimensional searches and at problems whose evaluations are expensive.
For the basics of black-box optimization with machine learning and quantum annealing/Ising machines,
see
Black-Box Optimization with Quantum
Annealing and Ising Machines, and for other examples of black-box optimization methods, see here.