Interview Q&A / Machine Learning

IntermediateQuick answer1 min readUpdated 3 Oct 2026

What is multicollinearity, and how do you detect and fix it?

SHORT ANSWER

Multicollinearity means two or more features are strongly correlated, so a linear model cannot tell their effects apart and coefficients become unstable. Detect it with a correlation matrix or VIF above about 5-10. Fix it by dropping or combining features, PCA, or ridge regression.

Explain it simply

Suppose a house-price model uses both "area in square feet" and "area in square metres". They carry the same information. The model can give 100 to one and 0 to the other, or 50 to each, and fit equally well. Small changes in data swing the coefficients wildly, even though predictions stay fine.

Example

Variance Inflation Factor for a feature = 1 / (1 - R^2), where R^2 comes from regressing that feature on all the other features.

text
If another-features-predict-this-one R^2 = 0.90 -> VIF = 1 / 0.10 = 10
If R^2 = 0.50 -> VIF = 2
If R^2 = 0    -> VIF = 1 (no collinearity)
python
from statsmodels.stats.outliers_influence import variance_inflation_factor
vif = variance_inflation_factor(X.values, i)   # for column i

Fixes:

  • Drop one of the duplicated features.
  • Combine them (for instance area per room).
  • Apply PCA to get uncorrelated components.
  • Use ridge regression (L2), which shrinks and stabilises coefficients.

Tree models are not much bothered by it for prediction, though feature importances get split between correlated features.

What to say in the interview

"Multicollinearity inflates coefficient variance and makes them hard to interpret, while predictions can remain accurate. I detect it with a correlation heatmap and VIF, treat above 5 or 10 as a warning, and fix it by removing or merging features, PCA or ridge."

Common mistakes

  • Dropping features based on correlation with the target instead of with each other.
  • Worrying about it when only prediction accuracy matters.

#multicollinearity#vif#linear-regression

Related questions

Practise more Machine Learning questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Machine Learning quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.