liveBook · Manning

DBSCAN

As explained in Outlier Detection in Python

DBSCAN is a density-based clustering algorithm that forms clusters from regions of sufficiently dense observations and can leave some observations unclustered.

DBSCAN is a density-based clustering algorithm that identifies dense regions and permits some observations to remain outside every cluster. For outlier detection, clustered points are treated as inliers, while unclustered points receive the outlier label. section 3.2.3

A practical DBSCAN outlier-detection workflow is:

  • Prepare the data by replacing nulls, encoding categorical columns, and scaling numeric features when necessary. section 3.2.3
  • Inspect different eps values because one setting can flag too many or too few records. section 4.11
  • Compare DBSCAN with other detectors and manually assess whether flagged records are substantively interesting. section 4.11

Dataset applications

Using V6 and V19 from the wall-robot-navigation dataset produces three major clusters and several unclustered points flagged as outliers. On scaled baseball data, setting eps to 2.0 yields 1,255 inliers and 85 outliers; repeatedly varying eps creates a more graded DBSCAN score.

How Outlier Detection in Python covers it

How deep it goes
Covers preprocessing, fitting, label conversion, visualization, and eps sensitivity, without developing detailed density theory.
Examples
Uses wall-robot-navigation, baseball, and JM1 datasets with two-feature plots, scaled features, and repeated-eps scores.
What it assumes
Assumes numeric, non-null, similarly scaled features unless preprocessing supplies encoding, imputation, and scaling.
What you can do after
Apply it via scikit-learn to flag unclustered rows and compare results across eps settings.
How it connects
Connects clustering-based outlier detection with HDBSCAN, feature scaling, categorical encoding, and null-value replacement.

Also explained in

Compare how 3 books explain DBSCAN →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.