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.3.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.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbsod-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b788e8d0dea8259704fa4493c67397e49c0d36c9f164aab6c65142a457905b24
MD5 bce546411b68f114ea2aec7844fb3462
BLAKE2b-256 dc82f586cf2468479b77bb550c379fb64411c75fc925c4647a6dbedb6a884341

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dbsod-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 694e873b32220ad180f983e9cc04fb319e3280915f542efe49fdbb03ef479f35
MD5 330fcbdfc35d50f7b81e2e6d28045f5e
BLAKE2b-256 f0525b32c0270973546aa4b690b245e5c712b6cf884cdbb01be998956bfb3b80

See more details on using hashes here.

Provenance

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