What is feature engineering?
Feature engineering is deriving, transforming and selecting the input variables, or features, that help a model learn better from raw data, using domain knowledge.
It differs from representation learning in who creates the features: in feature engineering an expert decides which signals matter, while in representation learning the model learns them from data. Feature extraction is a narrower term for obtaining features automatically or with standard methods.
- Topic
- Machine learning, models and training
- Also known as
- Feature design
How feature engineering works
- Missing values are filled where needed, categorical fields encoded as numbers and numeric variables scaled for scale-sensitive models.
- New features are derived with domain knowledge, such as day of week from a transaction date, a ratio of two amounts or a customer's average transaction over three months.
- Weak or redundant features are dropped, as are features that indirectly contain the target and cause leakage.
- The same transformations apply consistently in training and production, often through a feature store.
In more detail
Temporal and entity-level features
Temporal and entity-level aggregations, such as rolling 7-day or 30-day transaction counts, time since last event, lag features and cyclical time encodings, require strict point-in-time cutoffs. A common subtle bug is including events that occurred hours after the prediction timestamp or computing aggregations across future partitions.
Feature preparation by model family
Different model families demand different feature preparation: linear models, SVMs and neural networks are sensitive to feature scale, outliers and non-linear interactions, whereas gradient-boosted decision trees (XGBoost, LightGBM, CatBoost) handle monotonic transformations and missing values natively yet still benefit from interaction ratios and high-cardinality target or frequency encodings. Tabular foundation models reduce boilerplate preprocessing on small-to-medium datasets, though domain aggregations remain decisive at enterprise scale.
Commonly confused terms
| Term | How it differs |
|---|---|
| Feature selection | Feature selection picks a subset of existing features without creating new ones (reducing redundancy and overfitting), whereas feature engineering creates new informative variables and transforms distributions from raw inputs. |
Why feature engineering matters for on-premises AI
In tabular models for credit, fraud, faults and churn much of the performance comes from well-chosen features; deep learning has not removed feature engineering there. In on-premise projects this is how domain experts' knowledge reaches the model. In language model applications, well-prepared context and document structure take the place of hand-designed features.
An insurer derives the days between policy start and claim date and the number of claims from the same address as new features for its fraud model, then compares the model's test performance with the previous version.
Common questions
Has deep learning made feature engineering unnecessary?
Largely for text, images and audio. For tabular data well-designed features remain among the most effective tools.
What is the most common mistake in feature engineering?
Using a feature that indirectly contains the target, known as data leakage. The model looks excellent in testing but fails in production where that information is absent.
Related terms
- Feature extraction
- Feature store
- Machine learning
- Feature importance
- Representation learning
- Data leakage in machine learning
- Data augmentation
Sources
In the glossary: Glossary, D to L