What is the main goal of Principal Component Analysis (PCA)?
PCA aims to reduce the number of variables in data by transforming them into a smaller set of new variables called principal components, which capture most of the original data's variation.
Click to reveal answer
beginner
In PCA, what does the first principal component represent?
The first principal component is the direction in the data with the greatest variance, meaning it captures the most information from the original dataset.
Click to reveal answer
beginner
Which MATLAB function is commonly used to perform PCA?
The MATLAB function pca() is used to perform Principal Component Analysis on a dataset.
Click to reveal answer
intermediate
Why do we often center data before applying PCA?
Centering data (subtracting the mean) ensures that PCA focuses on variance around the mean, making the principal components meaningful and not biased by the data's original location.
Click to reveal answer
intermediate
What does the explained variance ratio tell us in PCA?
The explained variance ratio shows how much of the total data variance each principal component accounts for, helping decide how many components to keep.
Click to reveal answer
What is the first step before applying PCA in MATLAB?
AAdd random noise to the data
BNormalize the data to range 0-1
CSort the data in ascending order
DCenter the data by subtracting the mean
✗ Incorrect
Centering the data by subtracting the mean is essential to ensure PCA captures variance around the mean.
Which MATLAB function returns the principal components of a dataset?
Apca()
Bsvd()
Cfft()
Dmean()
✗ Incorrect
The pca() function in MATLAB computes principal components.
What does a high explained variance ratio for the first principal component indicate?
AData has no variation
BMost data variation is captured by the first component
CThe first component is not important
DData is uniformly distributed
✗ Incorrect
A high explained variance ratio means the first component captures most of the data's variation.
How many principal components can PCA produce from a dataset with 5 variables?
A3
B1
C5
D10
✗ Incorrect
PCA can produce as many principal components as the number of original variables.
What is the benefit of reducing dimensions with PCA?
ASimplifies data while keeping important information
BIncreases data size
CRemoves all variation
DRandomizes data
✗ Incorrect
Reducing dimensions simplifies data analysis and visualization while preserving key information.
Explain the process of performing PCA on a dataset in MATLAB.
Think about how you prepare data and what MATLAB function you use.
You got /4 concepts.
Describe why PCA is useful in data analysis and what information the principal components provide.
Consider how PCA helps with large datasets.
You got /4 concepts.
Practice
(1/5)
1.
What is the main purpose of Principal Component Analysis (PCA) in MATLAB?
easy
A. To reduce the number of variables by finding main directions of data
B. To sort data in ascending order
C. To calculate the sum of all data points
D. To generate random numbers for data simulation
Solution
Step 1: Understand PCA goal
PCA finds new axes (principal components) that capture most data variation.
Step 2: Identify main purpose
It reduces data dimensions by focusing on important directions, simplifying analysis.
Final Answer:
To reduce the number of variables by finding main directions of data -> Option A
Quick Check:
PCA = Dimensionality reduction [OK]
Hint: PCA simplifies data by finding main directions [OK]
Common Mistakes:
Thinking PCA sorts data
Confusing PCA with summing data
Assuming PCA generates random data
2.
Which MATLAB command correctly performs PCA on a data matrix X?
easy
A. score = pca(X, 'score');
B. pca = X.coeff();
C. [coeff, score, latent] = pca(X);
D. coeff = pca(X, 'coeff');
Solution
Step 1: Recall MATLAB PCA syntax
The function pca returns coefficients, scores, and variances as outputs.
Step 2: Match correct syntax
Only [coeff, score, latent] = pca(X); correctly calls PCA and stores outputs.