Pythonic Outliers: Mastering LOF Detection
summary
Practical demo of scikit‑learn LOF shows density‑based anomaly scoring with concrete choices: use n_neighbors=20, p=1 (Manhattan) on a 500‑row CSV loaded with pandas and visualized with seaborn, then fit_predict to label anomalies. Notes that contamination default moved from 0.1 to contamination=auto, but users often set 0.1–0.2 or even 21% in examples; novelty mode changes whether new points update the model; recommends retraining for time‑drift and cautions about high dimensionality.
AI-written summary · about
chapters (13)
- 0:00Welcome and introduction
- 1:09What are outliers and LOF
- 3:42LOF algorithm basics
- 8:21Key parameters explained
- 16:04Use cases for LOF
- 19:19Hands-on demo setup
- 25:13Q&A on method comparison
- 26:20Choosing LOF parameters
- 27:27Misunderstood aspects of LOF
- 29:14LOF vs LOP
- 30:17LOF for extreme weather
- 31:22Distance metrics in N dimensions
- 33:04Closing remarks
