Skip to main content
Release files added late

3 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

Documentation Status MIT License

Pyprotoclust is an implementatin of representative hierarchical clustering using minimax linkage.

The original algorithm is from Hierarchical Clustering With Prototypes via Minimax Linkage by Jacob Bien and Robert Tibshirani.

Pyprotoclust takes a distance matrix as input. It returns a linkage matrix encoding the hierachical clustering as well as an additional list labelling the prototypes associated with each clustering. This allows a user to integrate with the existing tools in the SciPy hierarchical clustering module.

Installation:

pip install pyprotoclust

Usage:

from pyprotoclust import protoclust
import numpy as np
import scipy as sp
import scipy.cluster.hierarchy
import scipy.spatial.distance

# Generate two-dimensional toy data
n = 60
np.random.seed(4)
params = [{'mean': [-7, 0], 'cov': [[1, 1], [1, 5]]},
          {'mean': [1, -1], 'cov': [[5, 0], [0, 1]]},
          {'mean': [3, 7], 'cov': [[1, 0], [0, 1]]}]
data = np.vstack([np.random.multivariate_normal(p['mean'], p['cov'], n) for p in params])
X = sp.spatial.distance.squareform(sp.spatial.distance.pdist(data))

# Produce a hierarchical clustering using minimax linkage
Z, prototypes = protoclust(X)

# Generate clusters at a set cut_height using scipy's hierarchy module
cut_height = 7
T = sp.cluster.hierarchy.fcluster(Z, cut_height, criterion='distance')
L,M = sp.cluster.hierarchy.leaders(Z, T)

# Get the prototypes associated with the generated clusters
P = data[prototypes[L]]

The previous example produces a linkage matrix Z and prototypes P that can be used to produce dendrograms and other plots of the data.

A dendrogram of the hierarchical clustering example.

A dendrogram of the hierarchical clustering example with a dashed line at the example cut height.

A scatter plot of the  hierarchical clustering example.

A scatter plot of the example with circles centered at prototypes drawn with radii equal to the top-level linkage heights of each cluster.

Metadata

Release files for pyprotoclust 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

3 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for pyprotoclust 0.1.0
File Size Uploaded Provenance Actions
pyprotoclust-0.1.0.tar.gz 112.1 kB Without provenance Details for pyprotoclust-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyprotoclust 0.1.0
File Actions
pyprotoclust-0.1.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for pyprotoclust-0.1.0-cp38-cp38-win_amd64.whl
pyprotoclust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for pyprotoclust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
pyprotoclust-0.1.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for pyprotoclust-0.1.0-cp37-cp37m-win_amd64.whl
pyprotoclust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details for pyprotoclust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl

Total release size: 2.3 MB

Release files / pyprotoclust-0.1.0.tar.gz

Download URL pyprotoclust-0.1.0.tar.gz
Size 112.1 kB
Tags Source
SHA-256 checksum
How to use checksums
76918486c1cba1242e1aee0af985d687fb61aeb330745152e0a19cc947c00e5a
BLAKE2b-256 checksum
How to use checksums
0cac89a407807a369d8e4a8dd38c12711f00ce6e160f5d5223f326818f54f5ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.6 Linux/4.15.0-99-generic

Release files / pyprotoclust-0.1.0-cp38-cp38-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pyprotoclust-0.1.0-cp38-cp38-win_amd64.whl
Size 190.5 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
6181aa0f3ef352299c9f372ca2f303847f48965dd7487d3c1dcb219351915aad
BLAKE2b-256 checksum
How to use checksums
bdfd33e7dd20d2f1d9162029ec7494a4bc6732acb73f9fbe7d322133a515808f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.7.6 Linux/5.4.0-109-generic

Release files / pyprotoclust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl

Download URL pyprotoclust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Size 925.1 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3143f356f0d65a3197b8e8e928809d9ab73aef867435ffaed4820d65dbbc35fc
BLAKE2b-256 checksum
How to use checksums
73864299a992b4ef0df9fa39a7bd4d90969dff6290090e791474519f42bf3621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.6 Linux/4.15.0-99-generic

Release files / pyprotoclust-0.1.0-cp37-cp37m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pyprotoclust-0.1.0-cp37-cp37m-win_amd64.whl
Size 189.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
964e40ba8b5efc188732bb6b9414ce4c2d40bcfab27cb5e789f94527aaea4bf2
BLAKE2b-256 checksum
How to use checksums
4e347be904bf2aec3ff9d4b47d29c2d30d33bef72c871a3bfc865cf39c46b92b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.7.6 Linux/5.4.0-109-generic

Release files / pyprotoclust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pyprotoclust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Size 925.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
426683173cbd8e7332a2680583cb258a07c8e9e6782786bbbead5e242cbf1494
BLAKE2b-256 checksum
How to use checksums
3b87f562735830920f319d74b5b5573acf8cf21f9e90dae83e683c3d667a4045
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.6 Linux/4.15.0-106-generic

Security for pyprotoclust 0.1.0

Upload timing

Release files added late

3 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

5 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page