Skip to main content

DBSOD: Density-Based Spatial Outlier Detection

Reason this release was yanked:

Missing .so file

Project description

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 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
make build

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

Project details


Download files

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

Source Distribution

dbsod-0.0.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

dbsod-0.0.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dbsod-0.0.2.tar.gz.

File metadata

  • Download URL: dbsod-0.0.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbsod-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e968db6e8bc741b308c40279fbf7b5f365c1e441fd4a276cad7d94fded263c0a
MD5 73877d30443da548949e063c39d555a5
BLAKE2b-256 9fafdfa8346bc2b94f0cbbb9d9f30004fb91f46c062bf474bf46bc5671f6fbef

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.2.tar.gz:

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.2-py3-none-any.whl.

File metadata

  • Download URL: dbsod-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbsod-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbf7ef3dc55bda9ff5ec71cd89a506f513fc8e77ae8d45f0b6557919e05d6f61
MD5 4235780440ad2f0693060c2388bf1d87
BLAKE2b-256 c7da56887fcc7b98ef1d8d076778bf39177a7e3789ca0cd5da99f244056bd35a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbsod-0.0.2-py3-none-any.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