Challenge - 5 Problems
Model Comparison Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding Cross-Validation Purpose
Why do we use cross-validation when comparing machine learning models?
Attempts:
2 left
❓ Metrics
intermediate2:00remaining
Choosing the Best Metric for Imbalanced Data
You have a classification problem with very imbalanced classes. Which metric is best to compare models fairly?
Attempts:
2 left
❓ Predict Output
advanced2:00remaining
Output of Model Comparison Using Cross-Validation Scores
What is the output of the following Python code?
ML Python
from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import cross_val_score iris = load_iris() X, y = iris.data, iris.target model = DecisionTreeClassifier(random_state=42) scores = cross_val_score(model, X, y, cv=5) print(round(scores.mean(), 2))
Attempts:
2 left
❓ Hyperparameter
advanced2:00remaining
Effect of Increasing Number of Folds in Cross-Validation
What is the main effect of increasing the number of folds (cv) in k-fold cross-validation?
Attempts:
2 left
🔧 Debug
expert2:00remaining
Identifying the Error in Model Comparison Code
What error does the following code raise when trying to compare two models using cross-validation?
ML Python
from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import cross_val_score iris = load_iris() X, y = iris.data, iris.target model1 = LogisticRegression(max_iter=200) model2 = DecisionTreeClassifier() scores1 = cross_val_score(model1, X, y, cv=5) scores2 = cross_val_score(model2, X, y, cv=5) print(scores1.mean()) print(scores2.mean())
Attempts:
2 left