pydpc - a Python package for Density Peak-based Clustering
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)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
168c953d2656c73562e1fde5e9935db354669a37a91a38537c4dce5266b9f280
|
|
| MD5 |
d4b81a4a124de7e720cc6f1f328d8c32
|
|
| BLAKE2b-256 |
b6d71cebf2a54bf835fd631115e5a6845d6e9f3b96e28632b93373fb3b57adc9
|
Provenance
The following attestation bundles were made for pydpc-0.2.1.tar.gz:
Publisher:
release.yml on cwehmeyer/pydpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydpc-0.2.1.tar.gz -
Subject digest:
168c953d2656c73562e1fde5e9935db354669a37a91a38537c4dce5266b9f280 - Sigstore transparency entry: 2048766509
- Sigstore integration time:
-
Permalink:
cwehmeyer/pydpc@d3d916538cb650d7fad1940f3a9bffdee450f938 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/cwehmeyer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d3d916538cb650d7fad1940f3a9bffdee450f938 -
Trigger Event:
push
-
Statement type: