Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

A feature in machine learning is a measurable piece of information that a computer uses to make a prediction or decision. Features turn messy real-world data, such as images, text, sounds, or survey answers, into organized inputs a model can learn from. They matter because the quality of the features often controls how well the model performs.

A clear feature is like a useful clue in a science experiment or a well-chosen variable in a graph.

Key Facts

  • A feature is an input variable used by a machine learning model.
  • A data point can have many features, such as height, age, color, or word count.
  • A simple model can be written as prediction = f(features).
  • For one feature, a linear model can be written as y = mx + b.
  • For many features, a linear model can be written as y = w1x1 + w2x2 + ... + b.
  • Good features are relevant, accurate, consistent, and measured in a way the model can use.

Vocabulary

Feature
A feature is a measurable input used by a machine learning model to make a prediction.
Raw data
Raw data is information collected before it has been cleaned, organized, or converted into useful inputs.
Label
A label is the correct answer or target value a supervised learning model tries to predict.
Model
A model is a learned rule or pattern that maps features to predictions.
Feature engineering
Feature engineering is the process of creating, selecting, or transforming features to help a model learn better.

Common Mistakes to Avoid

  • Confusing a feature with a label is wrong because the feature is the input and the label is the answer the model is trying to predict.
  • Using features that are unrelated to the prediction is wrong because extra noise can make a model less accurate and harder to understand.
  • Forgetting to clean or standardize features is wrong because inconsistent units, missing values, and messy formats can confuse the model.
  • Assuming more features always make a better model is wrong because too many weak or repeated features can cause overfitting and slower learning.

Practice Questions

  1. 1 A student builds a model to predict a house price using size in square meters, number of bedrooms, age of the house, and distance to school. How many features does each house have?
  2. 2 A simple model predicts test score using hours studied: score = 8h + 35. If a student studies for 6 hours, what score does the model predict?
  3. 3 A model predicts whether an email is spam using word count, number of links, sender address type, and time sent. Explain which of these are features and what the label would be during training.