Challenge - 5 Problems
Anomaly Detection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediateWhat is the main goal of anomaly detection?
In simple terms, what does anomaly detection try to find in data?
Attempts:
2 left
💡 Hint
Think about what makes something stand out or look unusual.
✗ Incorrect
Anomaly detection focuses on finding data points that do not fit the normal pattern, meaning they are different or rare compared to most data.
❓ Predict Output
intermediateOutput of simple anomaly score calculation
Given the following Python code that calculates anomaly scores as the absolute difference from the mean, what is the output list?
ML Python
data = [10, 12, 10, 13, 100] mean = sum(data) / len(data) anomaly_scores = [abs(x - mean) for x in data] print([round(score, 2) for score in anomaly_scores])
Attempts:
2 left
💡 Hint
Calculate the mean first, then subtract each value and take absolute value.
✗ Incorrect
The mean is (10+12+10+13+100)/5 = 29.0. The anomaly scores are absolute differences from 29.0: |10-29|=19, |12-29|=17, |10-29|=19, |13-29|=16, |100-29|=71. Rounded to two decimals, the list is [19.0,17.0,19.0,16.0,71.0] which is option C.
❓ Model Choice
advancedBest model choice for anomaly detection in high-dimensional data
You have a dataset with many features (dimensions) and want to detect anomalies. Which model is best suited?
Attempts:
2 left
💡 Hint
Think about reducing dimensions to find unusual points.
✗ Incorrect
PCA reduces dimensionality and can highlight points that do not fit the main patterns, making it effective for anomaly detection in high-dimensional data.
❓ Metrics
advancedWhich metric is best to evaluate anomaly detection performance?
You have a model that flags anomalies. Which metric best measures how well it finds true anomalies without too many false alarms?
Attempts:
2 left
💡 Hint
Focus on how many flagged anomalies are actually correct.
✗ Incorrect
Precision measures the proportion of detected anomalies that are true anomalies, which is important to avoid false alarms.
🔧 Debug
expertWhy does this Isolation Forest model fail to detect anomalies?
You trained an Isolation Forest model but it flags almost all points as normal. What is the most likely cause?
ML Python
from sklearn.ensemble import IsolationForest model = IsolationForest(contamination=0.1, max_samples=100) model.fit(data) preds = model.predict(data) print(sum(preds == -1)) # Count anomalies
Attempts:
2 left
💡 Hint
Check if the model expects a different anomaly proportion than actual data.
✗ Incorrect
If contamination is set lower than the true anomaly rate, the model will label fewer points as anomalies, missing many.
