An empirical cumulative distribution function (ECDF) assigns each observed value the proportion of data points less than than or equal to it. Unlike a theoretical cumulative distribution, it uses the actual sample. For sorted values, the function increases as observations accumulate, showing where data are concentrated and where values are relatively rare. section 6.3
Listing 6.6 Example using an ECDF plot from seaborn
from sklearn.datasets import load_breast_cancer import matplotlib.pyplot as plt import seaborn as sns data = load_breast_cancer()['data'] col = 3 fig, ax = plt.subplots(nrows=1, ncols=4, figsize=(11, 2)) sns.histplot(data[:, col], ax=ax[0], bins=5) #1 sns.histplot(data[:, col], ax=ax[1], bins=20) #2 sns.histplot(data[:, col], ax=ax[2], bins=200) #3 sns.ecdfplot(data[:, col], ax=ax[3]) #4 plt.tight_layout() plt.show()
Plot an ECDF beside histograms with different bin counts to see why the ECDF avoids the arbitrary binning choice: steep regions contain many observations, while flatter regions contain few. section 6.3
ECDFs support fast, distribution-free outlier detection when applied feature by feature. ECOD uses them without tuning parameters, making the detector deterministic and scalable, but the independent-feature treatment cannot identify unusual combinations and primarily finds extreme values. COPOD extends empirical distributions into an empirical copula that estimates multivariate tail probabilities. section 6.3 section 6.4
Visualizing feature concentration
Load the breast-cancer dataset, select one feature, and plot histograms using 5, 20, and 200 bins alongside seaborn's ECDF. The ECDF remains free of a bin-count choice while revealing dense and sparse value ranges. section 6.3
