Course contentsShow
← Data Science
Lesson 1196 of 2,14530. Exploratory Data Analysis (EDA) ProcessFree lesson

Dimensionality Reduction for Visualization

Using PCA or t-SNE to visualize high-dimensional data in two or three dimensions.

Dimensionality Reduction for Visualization

What you'll learn: How to use PCA or t-SNE to compress high-dimensional data into 2D or 3D plots you can actually see and understand.

The Challenge of Many Dimensions

When your dataset has dozens or hundreds of features, plotting them all at once is impossible—our screens and brains work in two or three dimensions. Dimensionality reduction solves this by mathematically projecting your high-dimensional data into a lower-dimensional space while preserving as much important structure as possible.

Think of it like viewing a 3D sculpture's shadow on a wall. You lose some detail, but you can still see the overall shape and relationships.

Two Popular Techniques

PCA (Principal Component Analysis)

PCA finds the directions in your data with the most variance and uses those as new axes. It's linear, fast, and great for understanding which combinations of original features matter most. The first two or three principal components often capture much of your data's variance, making them perfect for visualization.

t-SNE (t-Distributed Stochastic Neighbor Embedding)

t-SNE focuses on preserving local structure—keeping similar data points close together in the reduced space. It's nonlinear and excels at revealing clusters and patterns that PCA might miss. It's slower but often produces more interpretable visualizations for complex data.

When to Use Which

Use PCA when you want speed, interpretability, and care about global structure. Use t-SNE when you suspect complex, nonlinear relationships and want to spot clusters or groupings visually.

Both transform your many-column dataset into just 2-3 coordinates per observation, which you can then plot with scatter plots to explore patterns, outliers, and groupings that multivariate analysis hinted at.

Key Takeaway: Dimensionality reduction techniques like PCA and t-SNE compress high-dimensional data into 2D or 3D visualizations, making patterns and clusters visible to the human eye.