Challenge - 5 Problems
UMAP Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding UMAP's Core Idea
What is the main goal of UMAP when reducing data dimensions?
Attempts:
2 left
💡 Hint
Think about what UMAP tries to keep similar between high and low dimensions.
✗ Incorrect
UMAP focuses on preserving the local relationships between points, meaning points close in high dimensions remain close in the reduced space.
❓ Predict Output
intermediate1:30remaining
UMAP Output Shape
What will be the shape of the output after applying UMAP with n_components=2 on a dataset X with shape (100, 50)?
ML Python
import numpy as np import umap X = np.random.rand(100, 50) reducer = umap.UMAP(n_components=2) X_reduced = reducer.fit_transform(X) print(X_reduced.shape)
Attempts:
2 left
💡 Hint
The number of rows stays the same; only the number of features changes.
✗ Incorrect
UMAP reduces the feature dimension from 50 to 2 but keeps the number of samples (100) unchanged.
❓ Hyperparameter
advanced2:00remaining
Effect of 'n_neighbors' in UMAP
What is the effect of increasing the 'n_neighbors' parameter in UMAP?
Attempts:
2 left
💡 Hint
Think about how many neighbors UMAP considers when building the graph.
✗ Incorrect
A higher 'n_neighbors' means UMAP considers more neighbors, capturing broader structure and less local detail.
❓ Metrics
advanced1:30remaining
Evaluating UMAP Embedding Quality
Which metric is commonly used to evaluate how well UMAP preserves local neighborhood structure?
Attempts:
2 left
💡 Hint
This metric measures how well neighbors in high dimensions remain neighbors in low dimensions.
✗ Incorrect
Trustworthiness measures how many neighbors in the low-dimensional space were also neighbors in the original space, indicating local structure preservation.
🔧 Debug
expert2:30remaining
UMAP Runtime Error Diagnosis
Given the code below, what is the most likely cause of the error?
import numpy as np
import umap
X = np.array([[1, 2], [3, 4], [5, 6]])
reducer = umap.UMAP(n_components=3)
X_reduced = reducer.fit_transform(X)
ML Python
import numpy as np import umap X = np.array([[1, 2], [3, 4], [5, 6]]) reducer = umap.UMAP(n_components=3) X_reduced = reducer.fit_transform(X)
Attempts:
2 left
💡 Hint
Check the relationship between n_components and input feature size.
✗ Incorrect
UMAP cannot reduce to more dimensions than the original features; here, original features are 2 but n_components is 3.