For a d-dimensional input vector x∈Rd, a full polynomial expansion of degree at most p (including the constant bias term 1) has D=(d+pp) features. What is D when d=10 and p=3, and what happens to unregularised least-squares linear regression if you only have n=200 training examples?

Foundations, Feature engineering
Level L2 Elementary. Length Short. Nature Mat Mathematical.

What's being asked

Whether you can evaluate the polynomial feature count formula and recognise when having more features than examples (D>n) makes unregularised linear regression underdetermined.

Key idea

Plugging d=10 and p=3 into D=(d+pp) gives 286 features. Because D=286 exceeds the n=200 training examples, there are more unknown weights than equations, so infinitely many weight vectors fit the training data and overfit.

Steps

  1. Plug d=10 and p=3 into the formula: D=(10+33)=(133)=13×12×113×2×1=13×2×11=286.
  2. Note that 286 includes the constant 1; if the intercept is counted separately, there are 285 non-constant polynomial features.
  3. Compare D=286 with n=200: you are fitting 286 weights using only 200 equations (training examples), so the system is underdetermined and X⊤X cannot be inverted uniquely.
  4. State the consequence and fix: infinitely many weight vectors achieve zero training error (severe overfitting); you need regularisation (such as ridge or lasso), fewer features, or more data.

Common mistakes

How long your answer should be

4–5 sentences with the calculation D=286 and the n<D consequence; under 2 minutes.

Read this

Previous in Foundations: Compute both the z-score standardised values (using population standard deviation) and the min-max scaled values on [0,1] for the feature vector [0,8,18,50]. What drawback of min-max scaling does this example reveal, and which ML algorithms do or do not require feature scaling?
Next in Foundations: What is the difference between a restriction (language) bias and a preference (search) bias, with one standard ML algorithm as an example of each, and why is a preference bias usually safer in practice?