Open In Colab

Module 04: Feature Engineering - Participation Exercises#

Exercise 4.1: Discussion - Domain Knowledge Features#

Type: 💬 Discussion (7 min)

You’re building a model to predict reaction yield. You have:

  • Temperature (K)

  • Pressure (atm)

  • Reactant concentrations (mol/L)

  • Catalyst loading (wt%)

  • Residence time (min)

Task: With 2-3 neighbors, brainstorm engineered features that might improve predictions. Think about:

  • Physical/chemical relationships (Arrhenius, ideal gas law, etc.)

  • Ratios and interactions

  • Domain-specific transformations

List at least 5 potential engineered features with brief justifications.

Engineered features:

Feature

Formula/Description

Justification

1.

2.

3.

4.

5.

Exercise 4.2: Mini-Exercise - Scaling Matters#

Type: 🔧 Mini-Exercise (6 min)

Demonstrate why feature scaling matters for distance-based algorithms.

import numpy as np
from sklearn.preprocessing import StandardScaler

# Two data points with different feature scales
# Point A: Temperature=400K, Pressure=5atm
# Point B: Temperature=401K, Pressure=6atm

A = np.array([400, 5])
B = np.array([401, 6])

# Task 1: Calculate Euclidean distance without scaling
# dist_unscaled = ???

# Task 2: Now consider that temperature range is 300-500K, pressure range is 1-10 atm
# Scale both points and calculate distance again
# (Hint: what's the relative change in each feature?)

# Task 3: Which distance is more "fair"? Why?

Exercise 4.3: Reflection - Feature Engineering Philosophy#

Type: 🤔 Reflection (3 min)

“Feature engineering is where domain expertise meets machine learning.”

Reflect on:

  1. Why might a chemical engineer create better features than a generic data scientist?

  2. Can we automate feature engineering? What are the limits?

  3. When might too many features be a problem?

Your reflection: