Skip to content

What is feature engineering?

Feature engineering builds and selects the variables a model uses, transforming available data into signals suited to the prediction the model must make.

Feature engineering is the construction and selection of variables that a machine learning model uses to make a prediction. A variable, or feature, describes something observable: a purchase date can become the number of days since purchase, and a series of orders can become a customer's average spend. The choice depends on the business problem and on what data is available when the prediction is made. The work includes transforming, combining, and selecting variables, as well as checking that calculations mean the same thing in testing and in production. Even a seemingly accurate prediction can be misleading if a variable contains information that arrives only after the decision. That is why asking which data exists in company systems is not enough: teams also need to know when it was recorded, who understands its meaning, and how it will be updated. The result is a set of usable, verifiable signals rather than a straight copy of the original columns.

See also: Data qualityHow fit your data is for its intended use: complete, correct, fresh and consistent across systems. Measured, not declared.

How to choose and check variables

Construction creates a new variable, such as an average of prior purchases; selection chooses which available variables to keep. A survey of automated data preparation treats automated feature extraction, construction, and selection as separate tasks.

The scikit-learn documentation shows why training data should be split from held-out test data first. Transformations that learn from data, including feature selection, should be fitted on training data alone and then applied to test data too. In the documentation's example, with randomly generated outcomes, selecting features before the split yields 76% accuracy, versus a chance-level 50% with the correct procedure; these figures describe that example, not a general estimate. A review of leakage causes describes another form of data leakage: variables available during training but not once the model is in production.

An enterprise example

An insurer wants to identify claims for closer review when they are reported. In this hypothetical example, the team builds a count of the customer's prior claims and checks that policies and claims are correctly linked. The count must be computed as of each claim's reporting date; run on today's records, it would include claims reported after that date, which the production model could not see. For the same reason, the outcome of the investigation into the current claim is excluded from the features. The business owner can ask for the model to be tested on claims reported after those it was trained on.

Why it matters for decision makers

Before buying a solution or setting a deadline, ask for each variable's source, owner, update frequency, and calculation rule. Data quality affects each variable's reliability; inconsistent definitions and duplicated logic can increase data debt. MLOps practices, the operational management of models, help keep transformations consistent between testing and production. When comparing tools, also ask whether generated variables can be inspected and their calculations reproduced. A study of 53 automated feature-engineering methods for tabular data from the research literature found them generally hard to use and poorly documented, though it examined only open-source code.

Frequently asked questions

Construction derives new variables from available data; selection chooses which variables the model will use.

Some transformations and selection can be automated, but the meaning, availability, and correctness of the variables still have to be checked.
  • Data qualityHow fit your data is for its intended use: complete, correct, fresh and consistent across systems. Measured, not declared.
  • Data debtData debt is the future work caused by neglected data, definitions, and dependencies, which make information more costly and risky for an organization to use.
  • MLOpsMLOps organizes the training, deployment, monitoring, and updating of machine learning models, connecting data, code, and operational ownership over time.
  • Model monitoringModel monitoring tracks the data, predictions, and outcomes of models in production to detect changes and decide when their performance calls for action.
  • Data leakageInformation unavailable at prediction time leaks into training, inflating test metrics artificially.

See it in the universe

If you need the AI in production, not in a demo, that is my job.

See AI integrations

Or write to me.