topskill.dev
CoursesTracks
All courses/Machine Learning FundamentalsPrincipal component analysis
Clustering and other approaches
4 / 9
← Machine Learning Fundamentals
○What machine learning learns○Features and labels○Training and inference○Regression or classification○The machine learning process○Data quality and coverage○Representing data✦Module Quiz
○Linear regression○Try a tiny linear model○Logistic regression○Nearest neighbors○Decision trees○Random forests○Boosting○Naive Bayes○Support vector machines✦Module Quiz
○Clustering○K-means○Choosing and interpreting clusters●Principal component analysis○Neural networks and deep learning○Self-supervised learning○Transfer learning○Reinforcement learning✦Module Quiz
○Generalization and overfitting○Holding out evaluation data○Data leakage○Baselines○Bias and variance intuition○Reading learning curves✦Module Quiz
○Prediction errors and residuals○Measuring regression error○Squared error and large misses○The confusion matrix○Precision and recall○Try a held-out classifier✦Module Quiz
○Bias and limits○Monitoring and drift○Comparing models for a decision✦Module Quiz
Clustering and other approaches

Principal component analysis

A parcel record might contain length, width, height, and several related measurements. Dimensionality reduction represents the record using fewer numbers. It can make a plot possible or reduce repeated information before another model uses the data.

Principal component analysis, or PCA, creates new features from weighted combinations of the original numerical features. It chooses directions along which the data varies most. The first component captures the largest available variation; later components capture additional variation in perpendicular directions.

If parcel length and width tend to rise together, one component might summarize an overall size direction. Keeping that component gives a compact description, but discards differences in other directions. The new value is not simply the old length column with a new name.

Large variation is not the same as useful prediction information. A small variation in a sensor reading might distinguish a rare fault, while a large variation in parcel size tells us little about faults. PCA ordinarily does not use target labels to decide what to preserve.

Units matter: a large numerical range can dominate the result. Fit scaling and PCA using training data only when they are part of a prediction pipeline, then apply the learned transformation unchanged to evaluation examples.

The first two components can provide a two-dimensional plot even when the source has many columns. The displayed axes are combinations of features, so points close in the plot may still differ in omitted directions. A tidy two-dimensional picture is therefore a partial view, not a complete account of the data.

Check your understanding

Does retaining the directions of greatest variation guarantee retaining the best information for predicting faults?

Answer: No. PCA does not ordinarily use fault labels, and a small-variation direction may carry the useful signal.

Fact 1
1 / 1
FACT 1

No. PCA does not ordinarily use fault labels, and a small-variation direction may carry the useful signal.