February 2019
Intermediate to advanced
386 pages
9h 54m
English
Let's now apply the Epanechnikov density estimation to perform an example of anomaly detection. According to the structure of the probability density, we have decided to impose a cut-off at p(x) < 0.005. Such a condition is displayed in the following screenshot:

The red dots indicate the age limits for a sample to be classified as an anomaly. Let's compute the probability densities for some test points:
import numpy as nptest_data = np.array([12, 15, 18, 20, 25, 30, 40, 50, 55, 60, 65, 70, 75, 80, 85, 90]).reshape(-1, 1)test_densities_epanechnikov = np.exp(kd_epanechnikov.score_samples(test_data)) ...