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 install_eigen
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,
    metric='euclidean'
)

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 = jul,
  title = {{DBSOD: Density-Based Spatial Outlier Detection}},
  url = {https://github.com/Kowd-PauUh/dbsod},
  version = {0.0.5},
  year = {2025}
}

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.0.5-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.5 MB view details)

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

dbsod-0.0.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.4 MB view details)

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

dbsod-0.0.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.4 MB view details)

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

dbsod-0.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.4 MB view details)

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

dbsod-0.0.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.3 MB view details)

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

dbsod-0.0.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.3 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.0.5-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 383bd7f44c41857fb661173049dabe4eb81a8a3cc0cb12d70c30c17407a9143e
MD5 74c875bb882d91a6277ef2e7679f7275
BLAKE2b-256 6d29ea084390e18185a93f4d43e8efa8edf1f1003d419824a94f1ac1d2ab374a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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.0.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 132e37f48157cdd042dc6bc2a0f2b6aec8f8f120f4a8d84a3dfacaa49440b65d
MD5 84d8d13ec3c0114f878a76e5b5330946
BLAKE2b-256 d17f08d05858b0ee89fb56ee918c626d4bd3f4c38da5d247c9a74450a39c9ac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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.0.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f14f2b5e9da45c7169174e5fe5e6b814b1597acbf86530980ee71ab855be650
MD5 54767c89102467aca1b03a83cda33f4c
BLAKE2b-256 acdb27ee96479fba41b56f1b65acb2135dee6faf8b95f67d3f7505abe742a04b

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c4e5e3465f4101a50f2eb2a54f3ea6db112d2660221dbffe0b98b05d7cecbb37
MD5 fa85119d62a938e7e3825c57de22d37c
BLAKE2b-256 63611f6b5103d4eef2236fdb997b8e5fbeda45d9b1aa6bad51d82a87f1b98b1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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.0.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d0695089e3abd499cd4c5defcc5968c4abd78283592d2152c605f59c3999852a
MD5 19d19f9437a95ab7b3f0d1a48e1c21a2
BLAKE2b-256 0073889c6f6facbdda8e1f61503c39a3d5c65f7bcf689463b31ca32c5ea03a4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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.0.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dbsod-0.0.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 93d9e0699cf51dd79c38d7c74e5cc041538166bdf27a6c3cf60764bdd01e8a72
MD5 0b1759d5cdbacc95150e5a04690337f7
BLAKE2b-256 a80fd63320149e957fe74df0a1b049dbeaaf1974de8b488bda4726bd5dde133a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.5-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