0
0
ML Pythonml~20 mins

Semi-supervised learning basics in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Semi-supervised Learning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main advantage of semi-supervised learning?

Semi-supervised learning uses both labeled and unlabeled data. What is the main advantage of this approach compared to supervised learning?

AIt does not need any data preprocessing.
BIt always achieves higher accuracy than supervised learning.
CIt only works with unlabeled data.
DIt requires fewer labeled examples, reducing labeling cost.
Attempts:
2 left
💡 Hint

Think about the cost and effort of labeling data.

Predict Output
intermediate
2:00remaining
Output of semi-supervised label propagation

Given the following Python code using label propagation, what is the predicted label for the unlabeled point?

ML Python
from sklearn.semi_supervised import LabelPropagation
import numpy as np

# Data points: 3 labeled, 1 unlabeled
X = np.array([[1, 2], [2, 3], [3, 4], [8, 9]])
# Labels: 0, 0, 1, -1 (unlabeled)
y = np.array([0, 0, 1, -1])

model = LabelPropagation()
model.fit(X, y)
predicted_label = model.transduction_[-1]
ARaises an error
B0
C-1
D1
Attempts:
2 left
💡 Hint

Label propagation assigns labels based on neighbors' labels.

Model Choice
advanced
1:30remaining
Choosing a model for semi-supervised learning

You have a small labeled dataset and a large unlabeled dataset. Which model is best suited for semi-supervised learning in this scenario?

ASupport Vector Machine with self-training
BStandard supervised Random Forest
CK-Means clustering
DLinear Regression
Attempts:
2 left
💡 Hint

Look for a model that can iteratively label unlabeled data.

Hyperparameter
advanced
1:30remaining
Key hyperparameter in label spreading

In label spreading, which hyperparameter controls how much the model trusts the initial labels versus the structure of the unlabeled data?

AAlpha (clamping factor)
BLearning rate
CNumber of neighbors
DRegularization strength
Attempts:
2 left
💡 Hint

This parameter balances label retention and propagation.

Metrics
expert
2:00remaining
Evaluating semi-supervised learning performance

You trained a semi-supervised model. Which metric is most appropriate to evaluate its performance on the labeled test set?

AMean squared error
BSilhouette score
CAccuracy
DAdjusted Rand index
Attempts:
2 left
💡 Hint

Consider that you have true labels for the test set.