Aggregating and thresholding the probabilities
There are many aggregation methods available when using ensembles. The most popular ones are the arithmetic mean and median.
You can use the mean almost always, while you can reserve the median for cases when you have at least three or more classifiers in your estimators.
Use the arithmetic averaging to filter the outliers from the apple dataset. probability_scores, and apple is available from the previous exercise. NumPy is also loaded.
Questo esercizio fa parte del corso
Anomaly Detection in Python
Istruzioni dell'esercizio
- Find the mean of
probability_scoresacross rows. - Create a boolean mask that returns True when the probability is over 0.75.
- Use the
is_outliermask to filter the outliers.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Find the mean across rows
mean_probs = ____
# Create a boolean mask that uses a 75% threshold
is_outlier = ____
# Use the mask to filter outliers from apple
outliers = ____
print(len(outliers))