Feature extraction
Feature extraction is turning raw data such as text, images or audio into numerical features a model can use, either with hand-designed methods or by reusing the internal representations of a trained neural network.
Models work on numbers, but much of the world's data is text, images and sound. Feature extraction bridges the gap. The scikit-learn documentation defines it as transforming arbitrary data, such as text or images, into numerical features usable for machine learning, and distinguishes it from feature selection, which chooses among features that already exist.
The classic example for text is the bag of words. Each document becomes a row and each word a column, and the cells count how often each word appears. A refinement called tf-idf gives less weight to words that appear in almost every document, such as "the", so that distinctive words count for more. For images, scikit-learn offers tools that cut pictures into small patches of pixels.
The term has a second, now common meaning. Google's machine learning glossary also uses it for taking the intermediate values calculated by a pre-trained or unsupervised model, such as the outputs of a neural network's hidden layers, and using them as the input to another model. A team with a few thousand labelled product photos can run them through a large network trained on millions of images, use its internal outputs as features and train a small classifier on top. Text embeddings from language models are used the same way.
Usage overlaps with neighbouring terms. Google notes that feature extraction is sometimes a synonym for feature engineering, and in dimensionality reduction it refers to building a smaller set of new variables from the originals, as principal component analysis does.
The choice is a trade-off. Hand-designed features are cheap to compute and easy to inspect: you can see exactly which words drove a prediction. Features taken from a large neural network save the design work but are much harder to interpret, and they carry over whatever the original network learned, including its blind spots.
It is converting raw data such as text, images or audio into numbers a model can use. It can be done with fixed methods such as counting words, or by passing data through a pre-trained neural network and using its internal outputs as features. Feature extraction creates numerical features from raw data or combines existing variables into new ones. Feature selection keeps a subset of features that already exist and drops the rest. Both can reduce the number of inputs a model has to handle. It is the method or model that produces the features. In deep learning, the term usually means a pre-trained network, or the early layers of one, used to turn raw inputs such as images into feature vectors for another model. Yes. An embedding model turns text, images or other data into vectors of numbers that capture their meaning, and those vectors are commonly used as features for search, clustering or classification.Common questions
What is feature extraction in machine learning?
What is the difference between feature extraction and feature selection?
What is a feature extractor?
Are embeddings a form of feature extraction?
Search for "feature extraction", "bag of words tf-idf" or "pre-trained model as feature extractor". Library documentation such as scikit-learn's feature extraction guide and machine learning framework tutorials on transfer learning give practical examples. Check which meaning a writer has in mind, since the term covers both hand-designed and learned features.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.