Challenge - 5 Problems
Classification Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why does classification output categories?
Imagine you have a basket of fruits and you want to sort them into apples, oranges, and bananas. Why does a classification model predict categories instead of numbers?
Attempts:
2 left
❓ Predict Output
intermediate2:00remaining
Output of classification prediction code
What is the output of this code that uses a simple classification model to predict the category of a flower?
ML Python
from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier iris = load_iris() X, y = iris.data, iris.target model = DecisionTreeClassifier(random_state=0) model.fit(X, y) prediction = model.predict([[5.1, 3.5, 1.4, 0.2]]) print(prediction)
Attempts:
2 left
❓ Model Choice
advanced2:00remaining
Choosing a model for category prediction
You want to build a model that predicts if an email is spam or not (two categories). Which model is best suited for this classification task?
Attempts:
2 left
❓ Metrics
advanced2:00remaining
Which metric measures classification accuracy?
You trained a classification model and want to know how often it predicts the correct category. Which metric should you use?
Attempts:
2 left
🔧 Debug
expert2:00remaining
Why does this classification code raise an error?
Consider this code snippet that tries to predict categories but raises an error. What is the cause?
ML Python
from sklearn.tree import DecisionTreeClassifier model = DecisionTreeClassifier() model.fit([[1, 2], [3, 4]], [0, 1]) prediction = model.predict([1, 2]) print(prediction)
Attempts:
2 left