In plain words
A computer cannot look at a home the way we do. It needs the home described as a list of facts it can count or compare: number of bedrooms, age in years, floor area, whether a metro station is nearby. Each of those facts is a feature.
The thing we want the model to predict, like the price, is called the label. Features go in, a prediction comes out.
Choosing features matters a lot. Useful ones carry real information about the answer. Useless ones, like the colour of the front door, add noise. And some must be avoided, such as details that sneak in the answer or treat people unfairly. In modern deep learning, models often find their own features from raw pixels or words, but the idea is the same.
Everyday example
An auto driver quoting a fare
Before quoting, an auto driver weighs a few things: how far you are going, the time of night, whether it is raining, how bad the traffic is. Those are his features. The fare he names is the prediction. He ignores your shirt colour because it tells him nothing about the trip.
Where the example breaks: The driver picked his features from years of experience and common sense. A model only uses the features it is given or can find in the data, and it cannot tell a sensible feature from one that is merely correlated by accident.
How it actually works
In machine learning, each example is turned into a list of numbers called a feature vector. Every position in that list is one feature.
Raw data becomes numbers
Some features are already numbers (area, age). Others need converting: a yes or no becomes 1 or 0, a city becomes a set of on and off switches, a date becomes day of week and month.
Feature engineering
People decide which features might help and build better versions of them, for example grouping ages into ranges or combining two features into one. Google's glossary calls this feature engineering, also known as feature extraction.
Testing what matters
One way to judge a feature is to retrain the model without it. If accuracy drops sharply, the feature was carrying real information. If nothing changes, it can go.
Beware leaks
Label leakage happens when a feature quietly gives away the answer, for instance a field that is only filled in after a customer has already bought. The model looks perfect in training and fails in real use.
Learned features
A neural network builds its own features layer by layer. In image models, the first layers learn simple edge and colour detectors that are useful across many tasks, which is why transfer learning works.
- Also called
- Input variable, attribute; a list of them is a feature vector
- Opposite number
- The label: the output the model predicts
- Building them by hand
- Feature engineering, also called feature extraction or featurisation
- Learned automatically
- In deep learning, hidden layers learn features, and an embedding is a learned feature vector
Questions people ask
What is a feature in machine learning, in simple words?
One piece of information about an example that the model uses to make its prediction. For a house it could be the number of rooms; for an email, how many links it contains; for a photo, the brightness of each pixel.
What is the difference between a feature and a label?
Features are the inputs, the details we already know. The label is the output, the answer we want predicted. In a house price model, rooms and area are features and the price is the label.
Is a feature in AI the same as a feature of an app?
No. An app feature is something the app can do, like dark mode. In machine learning, a feature is a measurable property of the data. Same word, unrelated meanings.
What is feature engineering?
The work of choosing, cleaning and combining raw data into features that help a model learn. It used to be the biggest part of building a model. Deep learning now does much of it automatically, but it still matters for tables of business data.