LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Anomaly Detection in Python

Kurs anzeigen

Anleitung zur Übung

  • Find the mean of probability_scores across rows.
  • Create a boolean mask that returns True when the probability is over 0.75.
  • Use the is_outlier mask to filter the outliers.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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))
Code bearbeiten und ausführen