For a -dimensional input vector , a full polynomial expansion of degree at most (including the constant bias term ) has features. What is when and , and what happens to unregularised least-squares linear regression if you only have 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 () makes unregularised linear regression underdetermined.
Key idea
Plugging and into gives features. Because exceeds the training examples, there are more unknown weights than equations, so infinitely many weight vectors fit the training data and overfit.
Steps
- Plug and into the formula:
- Note that includes the constant ; if the intercept is counted separately, there are non-constant polynomial features.
- Compare with : you are fitting weights using only equations (training examples), so the system is underdetermined and cannot be inverted uniquely.
- 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
- Computing , which double-counts symmetric products like and and omits lower-degree terms.
- Using , which counts only terms of exact degree and drops degrees .
How long your answer should be
4–5 sentences with the calculation and the 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 for the feature vector . 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?