👉 Kernel Density Estimation (KDE) is a non-parametric method used to estimate the probability density function of a random variable. It works by placing a kernel (a smooth, symmetric function) at each data point and summing these kernels to create a smooth density estimate. The bandwidth parameter controls the width of these kernels, balancing detail and smoothness: a small bandwidth captures more detail but can be noisy, while a large bandwidth produces a smoother estimate but may miss finer features. KDE is widely used in statistics and machine learning for tasks like visualization, anomaly detection, and density-based clustering, offering a flexible alternative to parametric models by adapting directly to the data's underlying distribution.