✨ Visual Editor

close

palette Canvas & Background

Gradient:arrow_forward
Text Color:
135Β°

style Card Style

40px
16px

text_fields Typography

16px
Matt Dancho (Business Science)
@mdancho84
Principal Component Analysis (PCA) is the gold standard in dimensionality reduction.

But almost every beginner struggles understanding how it works (and why to use it).

In 3 minutes, I'll demolish your confusion:
Thread image
Matt Dancho (Business Science)
@mdancho84
1. What is PCA?

PCA is a statistical technique used in data analysis, mainly for dimensionality reduction. It's beneficial when dealing with large datasets with many variables, and it helps simplify the data's complexity while retaining as much variability as possible.
Thread image
Matt Dancho (Business Science)
@mdancho84
2. How PCA Works:

PCA has 5 steps; Standardization, Covariance Matrix Computation, Eigen Vector Calculation, Choosing Principal Components, and Transforming the data.
Matt Dancho (Business Science)
@mdancho84
3. Standardization:

The first step in PCA is to standardize the data. Since the scale of the data influences PCA, standardizing the data (giving it mean of 0 and variance of 1) ensures that the analysis is not biased towards variables with greater magnitude.
Thread image
Matt Dancho (Business Science)
@mdancho84
4. Covariance Matrix Computation:

PCA looks at the variance and the covariance of the data. Variance is a measure of the variability of a single feature, and covariance is a measure of how much two features change together. The covariance matrix is a table where each element represents the covariance between two features.
Thread image
Matt Dancho (Business Science)
@mdancho84
5. Eigenvalue and Eigenvector Calculation:

From the covariance matrix, eigenvalues and eigenvectors are calculated. Eigenvectors are the directions of the axes where there is the most variance (i.e., the principal components), and eigenvalues are coefficients attached to eigenvectors that give the amount of variance carried in each Principal Component.
Thread image
Matt Dancho (Business Science)
@mdancho84
6. Principal Components:

The eigenvectors are sorted by their eigenvalues in descending order. This gives the components in order of significance. Here, you decide how many principal components to keep. This is often based on the cumulative explained variance ratio, which is the amount of variance explained by each of the selected components.
Thread image
Matt Dancho (Business Science)
@mdancho84
7. Transforming Data:

Finally, the original data is projected onto the principal components (eigenvectors) to transform the data into a new space. This results in a new dataset where the variables are uncorrelated and where the first few variables retain most of the variability of the original data.
Thread image
Matt Dancho (Business Science)
@mdancho84
8. Evaluation:

Each PCA component accounts for a certain amount of the total variance in a dataset. The cumulative proportion of variance explained is just the cumulative sum of each PCA's variance explained. Often this is plotted on a Scree plot with Top N PCA components.
Thread image
Matt Dancho (Business Science)
@mdancho84
EVERY DATA SCIENTIST NEEDS TO LEARN AI IN 2025.

99% of data scientists are overlooking AI.

I want to help.

This is how:
Matt Dancho (Business Science)
@mdancho84
🚨 NEW WORKSHOP: I'm sharing one of my best AI Projects for FREE:

How I built an AI Customer Segmentation Agent with Python:

- Scikit Learn
- K-Means
- LangChain
- LangGraph
- OpenAI

πŸ‘‰Register here (500 seats): learn.business-science.io/ai-register
Thread image
Matt Dancho (Business Science)
@mdancho84
That's a wrap! Over the next 24 days, I'm sharing the 24 concepts that helped me become an AI data scientist.

If you enjoyed this thread:

1. Follow me @mdancho84 for more of these
2. RT the tweet below to share this thread with your audience
Generated by Thread Navigator
100%
view_carousel Carousel Studio NEW
Press ⌘ + S to quick-export