Skip to main content

pydpc - a Python package for Density Peak-based Clustering

CI codecov CodeQL Docs PyPI version PyPI downloads

Clustering by fast search and find of density peaks was designed by Alex Rodriguez and Alessandro Laio; see their project page for more information.

The pydpc package aims to make this algorithm available for Python users.

Installation

Install pydpc via pip from the Python package index

pip install pydpc

or the latest version from github

pip install git+https://github.com/cwehmeyer/pydpc.git@master

Quick start

import numpy as np
from pydpc import Cluster

# a simple bimodal data set: two gaussian blobs centered at x=-4 and x=+4
npoints = 1000
points = np.random.randn(npoints, 2)
points[:, 0] += 4 * np.random.choice([-1, 1], size=npoints)

# computes distances, density, and delta, then shows the decision graph
clu = Cluster(points)

# pick outliers in the decision graph as cluster centers and assign points
clu.assign(min_density=25, min_delta=6)

clu.membership   # cluster index for each point
clu.core_idx     # indices of high-confidence ("core") points
clu.halo_idx     # indices of low-confidence ("halo") points

See docs/examples/Example01.ipynb for a full walkthrough with plots.

See CHANGELOG.md for release history.

Download files

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

Source Distribution

pydpc-0.2.1.tar.gz (1.2 MB view details)

Uploaded Source

File details

Details for the file pydpc-0.2.1.tar.gz.

File metadata

  • Download URL: pydpc-0.2.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydpc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 168c953d2656c73562e1fde5e9935db354669a37a91a38537c4dce5266b9f280
MD5 d4b81a4a124de7e720cc6f1f328d8c32
BLAKE2b-256 b6d71cebf2a54bf835fd631115e5a6845d6e9f3b96e28632b93373fb3b57adc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydpc-0.2.1.tar.gz:

Publisher: release.yml on cwehmeyer/pydpc

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

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 file

0.2.0

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

Supported by

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