Data Science Foundations · Beginner → Intermediate

Feature Engineering Studio

Keep the learner fixed and change only φ(x): raw x, standardized x, x², or bucket indicators—then inspect the design row and prediction terms.

A representation-first regression lab. The same train/validation split and ordinary least-squares learner are refitted after each feature transformation so students can separate a model's learning rule from the information made available in its feature vector.

Step by step

  1. Start from raw x and fit an ordinary straight-line model on the training split.
  2. Standardize x using mean and standard deviation calculated only from training x.
  3. Add x² to the feature vector so the same linear learner can represent curvature.
  4. Replace exact x with fixed range indicators to see what bucketing preserves and discards.
  5. Inspect the selected sample's design vector φ(x), fitted coefficients β, and each βⱼφⱼ contribution.
  6. Compare train and held-out validation MSE/R² while changing only the representation.

Core formulas

Feature map

x → φ(x)

Feature engineering changes the representation consumed by the learner.

Linear prediction

ŷ = βᵀφ(x)

The learner stays linear in fitted coefficients even when φ includes nonlinear raw-data transforms.

Training-only standardization

z = (x − μ_train) / σ_train

Transformation statistics are learned from training data and then reused on validation data.

When to use Feature Engineering Studio

  • Understanding the difference between model capacity and input representation.
  • Seeing why polynomial features can expose curvature to a linear learner.
  • Learning what normalization and bucketing do to the actual feature vector.

Primary references

Google ML Crash Course — Numerical feature vectors

Google ML Crash Course — Feature crosses