Challenge - 5 Problems
Random Forest Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
How does a random forest reduce overfitting compared to a single decision tree?
Random forests use many decision trees to make predictions. Which of the following best explains how this helps reduce overfitting?
Attempts:
2 left
❓ Predict Output
intermediate2:00remaining
Output of random forest prediction probabilities
What is the output of the following Python code using scikit-learn's RandomForestClassifier?
ML Python
from sklearn.ensemble import RandomForestClassifier import numpy as np X_train = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) y_train = np.array([0, 1, 0, 1]) model = RandomForestClassifier(random_state=42) model.fit(X_train, y_train) X_test = np.array([[2, 3]]) pred_probs = model.predict_proba(X_test) print(pred_probs)
Attempts:
2 left
❓ Hyperparameter
advanced1:30remaining
Effect of increasing n_estimators in RandomForestClassifier
What is the most likely effect of increasing the n_estimators parameter (number of trees) in a RandomForestClassifier?
Attempts:
2 left
❓ Metrics
advanced2:00remaining
Choosing the best metric for imbalanced classification with Random Forest
You train a RandomForestClassifier on a dataset where 95% of samples belong to class 0 and 5% to class 1. Which metric is best to evaluate your model's performance?
Attempts:
2 left
🔧 Debug
expert2:00remaining
Debugging RandomForestClassifier training error
What error will this code raise when training a RandomForestClassifier, and why?
ML Python
from sklearn.ensemble import RandomForestClassifier X_train = [[1, 2], [3, 4], [5, 6]] y_train = [0, 1] model = RandomForestClassifier() model.fit(X_train, y_train)
Attempts:
2 left