Multicollinearity › Principal Component Regression (PCR): Transforming Correlated Variables
Machine Learning from ScratchAll chapters Multicollinearity › Principal Component Regression (PCR): Transforming Correlated VariablesOne section · Sections in this chapter9 / 13 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Principal Component Regression (PCR) is another useful technique for handling multicollinearity. Instead of working with the original correlated variables, PCR maps them into a set of uncorrelated principal components that capture the most important information in the data.
The key insight is that principal components are orthogonal (uncorrelated) by construction, eliminating multicollinearity entirely. We can then use these components in regression analysis, often achieving better performance with fewer variables.
PCR works by:
- Standardizing the original variables
- Computing principal components that capture maximum variance
- Selecting the optimal number of components (often 95% of variance)
- Fitting regression using these uncorrelated components
This approach is particularly useful when we want to retain most of the original information while eliminating multicollinearity. Let's see how PCR performs with our health data:




Number of components to retain 95% variance: 4 Model Comparison: ============================================================ Metric Original PCR Improvement ------------------------------------------------------------ R-squared 0.532 0.532 -0.000 MSE 21.372 21.391 -0.019 Max VIF 103.3 N/A N/A VIF Analysis (Original Model): Age: 1.3 (Low) Height: 103.3 (High) Weight: 3.2 (Low) BMI: 99.4 (High) Systolic_BP: 1.3 (Low)