Features and Labels
What you'll learn: You'll understand what features and labels are in machine learning and how they form the foundation of all supervised learning tasks.
The Core Idea
In machine learning, we teach computers to make predictions by showing them examples. Every example has two parts:
- Features (also called input variables or attributes) are the measurable properties or characteristics we use to describe each example
- Labels (also called targets or outputs) are the answers or outcomes we want the model to predict
Think of it like teaching someone to identify fruit. The features are what you can observe: color, size, texture, shape. The label is what the fruit actually is: "apple," "orange," or "banana."
Understanding Their Roles
Features are your input data. If you're predicting house prices, features might include square footage, number of bedrooms, location, and age. If you're classifying emails as spam, features could be word frequencies, sender reputation, and presence of links.
Labels are what you're trying to predict. In the house price example, the label is the actual sale price. For email classification, it's "spam" or "not spam."
The machine learning algorithm's job is to discover patterns in the features that reliably predict the labels. During training, it sees both features and labels. During prediction on new data, it only sees features and must infer the label.
The Learning Task
In supervised learning, you provide pairs of (features, label) so the model learns the mapping from inputs to outputs. The quality and relevance of your features directly impact how well the model can learn this relationship.
Key Takeaway: Features are the input characteristics that describe your data, labels are the outputs you want to predict, and machine learning finds the relationship between them through example-based learning.