Notes

Feature

A machine learning model can’t look at the world directly—it needs the world translated into numbers or categories it can work with. A feature is one of those pieces of translated information: a measurable attribute used to help predict something.

What a feature is

In a dataset, a feature is typically a column (or input dimension) that describes each example (row). If you’re predicting house prices, features might include square footage, number of bedrooms, and neighborhood. The thing you’re trying to predict (price) is the label or target, not a feature.

Features can be:

  • Numeric (income, temperature)
  • Categorical (zip code, product type)
  • Binary (has_garage: yes/no)
  • Derived via feature engineering (price_per_sqft, “day of week” extracted from a date)

Concrete examples

  • Exam score prediction: hours studied, attendance rate, prior GPA.
  • Medical risk: age, blood pressure, cholesterol, smoking status.
  • Sales forecasting: past sales, promotions, season, competitor price.

Why features matter in AI/ML

Models learn patterns that connect features to the target. If features are noisy, irrelevant, or missing key signals, performance suffers even with a powerful algorithm. Good features improve:

  • Predictive accuracy (more signal, less noise)
  • Generalization (works on new data)
  • Interpretability (clearer drivers in linear models or via feature importance)

You’ll see features everywhere: in scikit-learn as the input matrix X, in pandas as columns, and in deep learning as input tensors.

Feature is an individual measurable attribute used to represent an example (observation) in a dataset, typically as one column in a feature matrix. Features can be numeric, categorical, binary, or derived via transformations (e.g., embeddings). They are crucial because model training and prediction depend on how well features capture signal about the target. Example: in credit-risk modeling, income, debt-to-income ratio, and payment history are features.

Imagine you’re trying to guess the price of a house. You’d look at clues like the number of bedrooms, the size, the neighborhood, and how old it is. Each of those clues is a feature.

In statistics and machine learning, a feature is one piece of information about something you’re studying—like a person, a photo, or a transaction. Features are the inputs a model uses to learn patterns and make predictions. For example, in spam detection, features might include “contains the word ‘free’,” the number of links, or the sender’s address.