Feature Engineering
Feature engineering is the process of transforming raw data into inputs that machine learning models can use effectively. It includes selecting relevant variables, creating new ones from existing data, handling missing values, and encoding non-numeric information so algorithms can learn patterns that lead to accurate predictions.
itArtificial intelligence and machine learning | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Feature Engineering
Feature engineering is the art of explaining your data to a machine that has no instinct for dates, addresses, customer behavior, or the rather meaningful absence of a value. A model receives a tidy matrix of numbers. The world, with customary indifference to tidy matrices, sends timestamps, text, categories, gaps, and records that happened at inconvenient moments.
The job is to turn those raw materials into a representation that matches the prediction. A timestamp may be more useful as day of week, time since an event, or a marker for business hours. A transaction log may become counts, sums, recency, and variability for each customer. Aggregation is how many rows become one useful statement about a group, which is less mystical than it sounds and more likely to break when the group boundary is wrong.
The first surprise is that missing data is not empty space. Missingness can describe a system failure, a condition that does not apply, or a useful pattern in its own right. Filling a gap with a median can be sensible. Adding a marker that the gap existed can be sensible too. Throwing both decisions into the nearest preprocessing function and hoping for a philosophical outcome is less reliable.
Categories require similar restraint. One-hot encoding gives unrelated labels their own binary columns; it does not declare that blue is greater than green, which is a small mercy. High-cardinality categories tempt target encoding, and target encoding tempts leakage. A feature that has quietly seen the target, or the future, will make a model look brilliant until the model meets tomorrow. Tomorrow is not impressed.
That is why a pipeline matters. It keeps imputation, scaling, encoding, and the model together so each learned transformation fits the training data and then applies to held-out or future data. The classifier sees transformed columns; the evaluator sees a result that has not borrowed answers from the test set. This is not glamorous infrastructure. It is the difference between a measurement and a souvenir.
Feature selection supplies the final bit of discipline. Selection can rank variables before modelling, compare subsets through modelling, or let a model suppress weak inputs while it trains. More columns do not automatically mean more knowledge. Redundant and irrelevant inputs can add noise, slow training, and encourage overfitting. The model knows only what the representation lets it know, which is both its limitation and its alibi.
Read the slides when you need the map from raw data to a model-ready matrix. Use the cheatsheet when choosing an encoding, transform, or selection method. The practice reference and exercise turn the leakage rules into an executable pipeline. The Reference tab then carries the route into the source material, where the details have the good manners to be precise.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://scikit-learn.org/stable/modules/preprocessing.html
Supports
- StandardScaler, MinMaxScaler, RobustScaler behavior
- One-hot, ordinal, and target encoding
- Log and power transforms for skew reduction
- Binning and discretization
- Scaling importance for distance-based and gradient-based models
- https://scikit-learn.org/stable/modules/feature_extraction.html
Supports
- Bag of words, TF-IDF, hashing vectorizer
- Distinction between feature extraction and feature selection
- Text and image feature extraction methods
- https://scikit-learn.org/stable/modules/impute.html
Supports
- SimpleImputer strategies (mean, median, most_frequent)
- KNNImputer and IterativeImputer
- Missing indicator features
- Imputation within pipelines
- https://scikit-learn.org/stable/modules/feature_selection.html
Supports
- Variance threshold
- Univariate selection (mutual information, chi-squared)
- Recursive feature elimination
- Model-based selection (L1 regularization, tree importance)
- https://scikit-learn.org/stable/modules/cross_validation.html
Supports
- Fitting transforms within CV folds to prevent leakage
- Train/test split methodology
- Data leakage through improper preprocessing
- https://scikit-learn.org/stable/modules/compose.html
Supports
- Pipeline construction for reproducible preprocessing
- ColumnTransformer for heterogeneous data types
- Preventing leakage through pipeline encapsulation
- https://developers.google.com/machine-learning/data-prep
Supports
- Feature crosses and interaction features
- Embeddings for categorical data
- Data cleaning at scale
- Production-oriented feature engineering
- https://www.featurestore.org/
Supports
- Feature store architecture and concepts
- Training-serving skew prevention
- Feature lifecycle management
- https://dl.acm.org/doi/10.1145/1097658.1097801
Supports
- The 1971 SMART retrieval system and weighted term representations in the Timeline artifact.
- https://cdn.aaai.org/AAAI/1992/AAAI92-020.pdf
Supports
- The Relief feature-weighting method in the Timeline artifact.
- https://link.springer.com/article/10.1023/A:1012487302797
Supports
- Support vector machine recursive feature elimination in the Timeline artifact.
- https://www.jmlr.org/papers/v3/guyon03a.html
Supports
- The 2003 variable and feature selection survey in the Timeline artifact.
- https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html
Supports
- The scikit-learn publication and reusable machine learning workflow tooling in the Timeline artifact.
- https://ieeexplore.ieee.org/document/7344858
Supports
- Deep Feature Synthesis and relational automatic feature construction in the Timeline artifact.
- https://www.uber.com/gb/en/blog/michelangelo-machine-learning-platform/
Supports
- Uber Michelangelo and its centralized Feature Store in the Timeline artifact.
- https://cloud.google.com/blog/products/ai-machine-learning/introducing-feast-an-open-source-feature-store-for-machine-learning
Supports
- The Feast open-source release in the Timeline artifact.
- https://docs.feast.dev/master
Supports
- Feast offline and online stores, feature definitions, and feature serving for the Landscape artifact.
- https://docs.tecton.ai/
Supports
- Tecton batch, stream, and real-time feature definitions and inference access for the Landscape artifact.
- https://docs.hopsworks.ai/latest/concepts/fs/
Supports
- Hopsworks feature groups, feature views, point-in-time joins, and online and offline access for the Landscape artifact.
- https://www.hopsworks.ai/pricing
Supports
- Hopsworks free and paid service options used for the Landscape pricing classification.
- https://docs.databricks.com/aws/en/machine-learning/feature-store/
Supports
- Databricks feature tables, Unity Catalog governance and lineage, and feature lookup for the Landscape artifact.
- https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store.html
Supports
- Amazon SageMaker Feature Store feature groups, online and offline stores, event-time history, and feature processing for the Landscape artifact.
- https://aws.amazon.com/sagemaker/ai/pricing/
Supports
- Amazon SageMaker Feature Store usage charges used for the Landscape pricing classification.
- https://learn.microsoft.com/en-us/azure/machine-learning/concept-what-is-managed-feature-store?view=azureml-api-2
Supports
- Azure managed feature-store transformation specifications, materialization, point-in-time joins, versioning, and sharing for the Landscape artifact.
- https://scikit-learn.org/stable/common_pitfalls.html
Supports
- Practice reference and exercise: fitting preprocessing within a Pipeline after the train/test split
- Exercise extension: why fitting transformations on all rows leaks held-out information
- https://scikit-learn.org/stable/auto_examples/compose/plot_column_transformer_mixed_types.html
Supports
- Practice reference and exercise: ColumnTransformer branches for numeric and categorical features
- Exercise: SimpleImputer, StandardScaler, OneHotEncoder, and LogisticRegression in one pipeline
- https://airbnb.tech/events/chronon-summit/
Supports
- Field Notes: scattered feature definitions, lineage gaps, and online-offline inconsistency as operational feature-engineering problems
- https://airbnb.tech/ai-ml/how-airbnb-measures-listing-lifetime-value/
Supports
- Field Notes: feature snapshots at prediction time, labels arriving over a future horizon, and changes between training and scoring populations
- https://airbnb.tech/ai-ml/embedding-based-retrieval-for-airbnb-search/
Supports
- Field Notes: precomputed daily listing features as a latency and freshness tradeoff
