Challenge - 5 Problems
PCA Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What does PCA primarily do to the data?
Imagine you have a dataset with many features. What is the main goal of applying Principal Component Analysis (PCA) to this data?
Attempts:
2 left
❓ Predict Output
intermediate2:00remaining
Output of PCA transformation on a simple dataset
What is the output of the following Python code using PCA?
ML Python
from sklearn.decomposition import PCA import numpy as np X = np.array([[2, 0], [0, 2], [3, 3]]) pca = PCA(n_components=1) X_pca = pca.fit_transform(X) print(X_pca.round(2))
Attempts:
2 left
❓ Hyperparameter
advanced2:00remaining
Choosing the number of components in PCA
You want to reduce your dataset's dimensions using PCA but keep at least 90% of the variance. Which approach correctly helps you decide the number of components?
Attempts:
2 left
❓ Metrics
advanced2:00remaining
Interpreting explained variance ratio from PCA
After fitting PCA on a dataset, you get explained variance ratios: [0.6, 0.3, 0.1]. What does this mean?
Attempts:
2 left
🔧 Debug
expert2:00remaining
Why does PCA output have unexpected shape?
You run this code but get an output shape of (5, 5) instead of (5, 2) as expected:
from sklearn.decomposition import PCA import numpy as np X = np.random.rand(5, 3) pca = PCA(n_components=2) X_pca = pca.fit_transform(X) print(X_pca.shape)
What is the most likely reason?
Attempts:
2 left