Art of DS

Appearance

Palette
Theme
Unlock $20 one time
Sign in, or create an account

Sign in to Art of DSCreate your Art of DS account

We email you a link and a six-digit code. Either one signs you in; there is no password.Enter your email. We send a link and a six-digit code to confirm it — no password to remember. The account is free.

  • You come back to this page, right where you were.
  • Already have an account? The same email simply signs you in.

By continuing you accept the Terms and the Privacy policy.

Your account

Free accountLifetime access

difficulty 2/5

Feature engineering

Definition

Deciding what the columns are — rescaling, encoding, combining and deriving inputs so that the structure a model can represent is the structure that is actually there.

Formula
(X1,X2)  ⟶  (1,  X1,  X2,  X12,  X1X2,  X22)(X_1, X_2) \;\longrightarrow\; (1,\; X_1,\; X_2,\; X_1^2,\; X_1X_2,\; X_2^2)

Intuition

A model can only find structure it is able to express. A linear model asks one question of each column — does the target go up with this? — and if the honest answer is "it goes up, then down, and wraps around at midnight", the column cannot carry it no matter how the coefficients are set.

Feature engineering is the work of changing the question. Not a better optimiser, not more layers: a different column, in which the answer the model can give happens to be the right one. Hour 23 and hour 0 are one hour apart in the world and twenty-three apart in the integer — so you supply a column in which they are adjacent, and the model stops having to fight the encoding.

Its status is easy to underrate because it sits before the modelling and looks like plumbing. Google's practical guidance devotes an entire phase to it, after the first pipeline is running and before anything sophisticated is attempted [2, ML Phase II: Feature Engineering].

Formal definition

How it works

Where it's used

Why & when

Worked example

Pitfalls

Check yourself

3 questions

The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.

Unlock all quizzes

On the cheat sheet: Missing data and outliers →

Sources

  1. Zhang, Lipton, Li, Smola. Dive into Deep Learningbook · retrieved 2026-09-05https://d2l.ai/
  2. Zinkevich. Rules of Machine Learning: Best Practices for ML Engineering (Google)docs · retrieved 2026-09-05https://developers.google.com/machine-learning/guides/rules-of-ml
  3. Sculley, Holt, Golovin, Davydov, Phillips, Ebner, Chaudhary, Young, Crespo, Dennison. Hidden Technical Debt in Machine Learning Systems (2015)paperhttps://proceedings.neurips.cc/paper_files/paper/2015/hash/86df7dcfd896fcaf2674f757a2463eba-Abstract.html
  4. scikit-learn User Guide — Preprocessing datadocs · retrieved 2026-09-05https://scikit-learn.org/stable/modules/preprocessing.html

Have a promo code?

A code that takes 100% off unlocks everything at once. A smaller one takes its share off the price in the payment window: enter the same code there.

Write to support

A question, a problem with access, a refund? Write to us and we answer by email.

What is it about?

Your address is used only to answer you.

Message sent

Thank you. We will reply to the address you gave, by email.

Or write to us directly

support@artofds.com

Message sent Thank you. We will reply to the address you gave, by email.

Check the email address: we need it to reply.

That is our own address. Enter yours, so the reply reaches you.

This address cannot receive email. Check it for a typo.

Write a little more: at least 10 characters.

Too many messages in a short time. Try again in a few minutes.

The message could not be sent. Please write to us directly: support@artofds.com