Challenge - 5 Problems
ML Types Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediateIdentify the type of learning from a description
You have a dataset with labeled images of cats and dogs. You want the model to learn to tell cats from dogs using these labels. What type of machine learning is this?
Attempts:
2 left
💡 Hint
Think about whether the data has labels or not.
✗ Incorrect
Supervised learning uses labeled data to teach the model. Here, images are labeled as cats or dogs, so it's supervised learning.
❓ Predict Output
intermediateOutput of clustering algorithm example
What is the output of this Python code using KMeans clustering on simple 2D points?
ML Python
from sklearn.cluster import KMeans import numpy as np points = np.array([[1,2],[1,4],[1,0],[10,2],[10,4],[10,0]]) kmeans = KMeans(n_clusters=2, random_state=0).fit(points) labels = kmeans.labels_ print(labels.tolist())
Attempts:
2 left
💡 Hint
Points near (1,*) will be in one cluster, points near (10,*) in another.
✗ Incorrect
KMeans groups points into clusters. Points with x=1 are grouped as cluster 0, points with x=10 as cluster 1.
❓ Model Choice
advancedChoosing the right ML type for a game AI
You want to build an AI that learns to play a video game by trying moves and getting points as feedback. Which type of machine learning should you use?
Attempts:
2 left
💡 Hint
The AI learns by trial and error with rewards.
✗ Incorrect
Reinforcement learning trains agents by rewarding good actions and punishing bad ones, perfect for game playing.
❓ Metrics
advancedEvaluating clustering quality
Which metric is commonly used to evaluate the quality of an unsupervised clustering model?
Attempts:
2 left
💡 Hint
This metric measures how well clusters are separated.
✗ Incorrect
Silhouette score measures how similar an object is to its own cluster compared to other clusters, useful for clustering evaluation.
🔧 Debug
expertWhy does this reinforcement learning code not update the policy?
Consider this simplified reinforcement learning code snippet. Why does the policy not improve after training?
ML Python
import numpy as np policy = np.array([0.5, 0.5]) rewards = [1, -1, 1, -1] actions = [0, 1, 0, 1] for r, a in zip(rewards, actions): policy[a] += 0.1 * r policy = policy / policy.sum() print(policy)
Attempts:
2 left
💡 Hint
Check if policy values remain valid probabilities after updates.
✗ Incorrect
Adding negative rewards directly can make probabilities negative, which is invalid for a probability distribution.
