openskills.info
Open Course

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

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