Skip to main content

DBSOD: Density-Based Spatial Outlier Detection

Project description

DOI

DBSOD: Density-Based Spatial Outlier Detection

Official implementation of "DBSOD: Density-Based Spatial Outlier Detection". Paper preprint is coming soon.

Algorithm

While DBSCAN is a widely used clustering algorithm, it only provides a binary label for outliers and does not assign a continuous outlierness score. To address this limitation, we propose DBSOD, a density-based spatial outlier detection method inspired by DBSCAN. The algorithm estimates the consistency with which a data point is identified as an outlier across a range of neighborhood sizes:

DBSOD Algorithm

The algorithm systematically varies the neighborhood size parameter $\epsilon$, evaluating outlierness across multiple density assumptions. By aggregating binary outlier classifications across these scales, it produces a normalized outlierness score for each point, reflecting how consistently the point is identified as an outlier.

Installation

Note: the package was developed for Linux (manylinux, x86_64) machines.

You can install package using pip:

pip install dbsod

Alternatively (for instance if you want to contribute) you may clone this repository, build dbsod and install it in .venv in editable mode:

git clone https://github.com/Kowd-PauUh/dbsod.git
cd dbsod
make install_g++
make venv

Usage

Take as an example this dataset:

import numpy as np

DATA = np.array([
    [0.35, 0.18],
    [0.60, 0.16],
    [0.40, 0.18],
    [0.40, 0.30],
    [0.30, 0.70],
])

We can use dbsod to calculate outlierness score for each point:

from dbsod import dbsod

EPS_SPACE = [0.15, 0.22]  # `eps` parameters used for calculating normalized outlierness score
MIN_PTS = 2               # minimum number of neighbors for the data point to become "core" point

# compute outlierness scores
outlierness_scores = dbsod(
    X=DATA,
    eps_space=EPS_SPACE,
    min_pts=MIN_PTS,
)

print(outlierness_scores)

The output will be: array([0. , 0.5, 0. , 0. , 1. ]).

Below is the visualization of this example:

Simple Example

On the real-world data (check out this example) result of DBSOD would look like:

Real-World Example

Citation

@software{danylenko2025dbsod, 
  author = {Danylenko, Ivan},
  doi = {10.5281/zenodo.17806900},
  month = apr,
  title = {{DBSOD: Density-Based Spatial Outlier Detection}},
  url = {https://github.com/Kowd-PauUh/dbsod},
  version = {0.0.5},
  year = {2026}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dbsod-0.1.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dbsod-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dbsod-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dbsod-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dbsod-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dbsod-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file dbsod-0.1.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06acf148fc1a906f08fe5b690882092c59f8ade94d879f2bb3126b7da9c99489
MD5 ca1624cd4ed7765ae349b36ed552abe1
BLAKE2b-256 51106d7e44b01c1db937f8cfe5cef925fd169c48995fce6c7d885b10cb73ed8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbsod-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 af0cf24695b14ec34500123a647f776363a96a7e04b2286bb3ec6d0472fca3ca
MD5 03b3b27d95959dc51952aa11e539c76d
BLAKE2b-256 f77e23859286a19702124a354d0198e4b53f0ad489110909f33ad697459a6474

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbsod-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08e6147b0620fef379868065c980823e4212ada9250c592cf0bd81076efec51c
MD5 961f84a55c71f01dcc8a9fa1e11242e3
BLAKE2b-256 4c878ef050546e2a92971de76a3f946685626b05b75245475a6917923d3b0788

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbsod-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 36c5ea385013c36086620184ee52ac36e25f9f075e9e40024cf770d17d5c09c4
MD5 34cd3dce592db0bc1ac984d6fc30a1fd
BLAKE2b-256 694dc032fe28eb26b990119f467da884d74d42348cb3bd87d582eeb6a5c9ac41

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbsod-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cac2a23c217feafa92df164d1c72e2d31cb30796afdc49ed47ac1f7a420ac237
MD5 e3012b0888be162800a5bbe095e0ddf5
BLAKE2b-256 e04497bf90021617b58d5c0c97880db9089cd8ab8fa2b196feb8f61b6fa7cd77

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbsod-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8514f09965514321d24006e9a45205e3fce98ab3aa7cb57e53786f637f56ebbc
MD5 90ab77b71aba07a77ee5d59440b74522
BLAKE2b-256 add103374622d117b9cb706090d3550e2b96a8230100c93b3aeb1f875ed3cb97

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on Kowd-PauUh/dbsod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page