Skip to main content

Flare-Sensitive Clustering based on HDBSCAN*.

Project description

PyPI version Tests

FLASC: Flare-Sensitive Clustering

FLASC - Flare-Sensitive Clustering, adds an efficient post-processing step to the HDBSCAN* density-based clustering algorithm to detect branching structures within clusters.

The algorithm adds two parameters that may need tuning with respect to HDBSCAN*, but both are intuitive to tune: minimum branch size and branch selection strategy.

How to use FLASC

The FLASC package is closely based on the HDBSCAN* package and supports the same API, except sparse inputs, which are not supported yet.

from flasc import FLASC
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

data = np.load('./notebooks/data/flared_clusterable_data.npy')
clusterer = FLASC(min_cluster_size=15)
clusterer.fit(data)
colors = sns.color_palette('tab10', 10)
point_colors = [
  sns.desaturate(colors[l], p)
  for l, p in zip(clusterer.labels_, clusterer.probabilities_)
]
plt.scatter(data[:, 0], data[:, 1], 2, point_colors, alpha=0.5)
plt.axis('off')
plt.show()

Example point cloud

Example Notebooks

A notebook demonstrating how the algorithm works is available at How FLASC Works. The other notebooks demonstrate the algorithm on several data sets and contain the analyses presented in our paper.

Installing

Binary wheels are available on PyPI. Presuming you have an up-to-date pip:

pip install pyflasc

For a manual install of the latest code directly from GitHub:

pip install --upgrade git+https://github.com/vda-lab/pyflasc.git#egg=pyflasc

Alternatively download the package, install requirements, and manually run the installer:

wget https://github.com/vda-lab/pyflasc/archive/main.zip
unzip main.zip
rm main.zip
cd flasc-main

pip install -t .

Citing

A scientific publication of this algorithm and codebase is in progress. Please refer back to this section to see how you can cite this work in the future.

This FLASC algorithm and software package is very closely related to McInnes et al.'s HDBSCAN* software package. If you wish to cite the HDBSCAN* package in a scientific publication, please use their Journal of Open Source Software article.

L. McInnes, J. Healy, S. Astels, *hdbscan: Hierarchical density based clustering*
In: Journal of Open Source Software, The Open Journal, volume 2, number 11.
2017
@article{mcinnes2017hdbscan,
  title={hdbscan: Hierarchical density based clustering},
  author={McInnes, Leland and Healy, John and Astels, Steve},
  journal={The Journal of Open Source Software},
  volume={2},
  number={11},
  pages={205},
  year={2017}
}

To reference their high performance algorithm please cite their paper in ICDMW 2017 proceedings.

McInnes L, Healy J. *Accelerated Hierarchical Density Based Clustering*
In: 2017 IEEE International Conference on Data Mining Workshops (ICDMW), IEEE, pp 33-42.
2017
@inproceedings{mcinnes2017accelerated,
  title={Accelerated Hierarchical Density Based Clustering},
  author={McInnes, Leland and Healy, John},
  booktitle={Data Mining Workshops (ICDMW), 2017 IEEE International Conference on},
  pages={33--42},
  year={2017},
  organization={IEEE}
}

Licensing

The FLASC package has a 3-Clause BSD license.

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

pyflasc-0.1.2.tar.gz (6.6 MB view details)

Uploaded Source

Built Distributions

pyflasc-0.1.2-cp311-cp311-win_amd64.whl (873.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyflasc-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyflasc-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (986.8 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyflasc-0.1.2-cp310-cp310-win_amd64.whl (873.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyflasc-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyflasc-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (986.8 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyflasc-0.1.2-cp39-cp39-win_amd64.whl (877.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyflasc-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyflasc-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (991.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file pyflasc-0.1.2.tar.gz.

File metadata

  • Download URL: pyflasc-0.1.2.tar.gz
  • Upload date:
  • Size: 6.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for pyflasc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 be795d0fc5a409e8b10b51947ba5fa9a30b47d94bc698c46516dd5db63e960f1
MD5 1b37b56a070abb9c0e6c83907d545218
BLAKE2b-256 f14b2efcab925026b208861f32c0837a1a35d45752a567eea0288fb1e5cbcede

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyflasc-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 873.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for pyflasc-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c06973c0d33b5209fe0c4a5edf788c486db864e801990ee3ed1354a26c3fba13
MD5 9e095eb2fb3453b3f7f6407610ce098f
BLAKE2b-256 bb8493b730bdd9055f8fef3c7f4c05004158015e22b9c1b813e5b74bffa548e6

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5b2032b1e2c32e1613c3760a8d733943dcd68e468f20aa559bd2189d9b697b8
MD5 90fbd02079137a6ad9da737cdbd736cf
BLAKE2b-256 6b25193d13d29bf5a7853fd983c59d7e79065f4fea6cc24e5d95bd8bb744bccc

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d1088ca0dd73ba21680e33c22d11c4f80e52fb6209250967126dc9831e21b11a
MD5 c60822d21cf81eeb0b283f3ad137a42f
BLAKE2b-256 dc7896b83a9c31fb0cb237d63bf5094e295e3a3752de4507fde5f651f4c9862a

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyflasc-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 873.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for pyflasc-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 100aa90a7c51317b01bd4984a1c7bc0807b10d79591d9561a3bbb28e9e9e7153
MD5 2cf8360b5467c4d655bbdc5cef1a814d
BLAKE2b-256 92199b8861fbbd8831df5dce8a5d7275c255018a81dffafa428d3ab966b63130

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e36e573ce7260e13fbc9f79f0bd2a12116d360f4aceeb798d2fe2743c5f5a44a
MD5 6c857337ec4e13aa2d51ebe4d1b7cdc8
BLAKE2b-256 85c9521f24c9f2de25aabed5b76b860f47a3eb3172491cfcfa403cfc77beee8e

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3777f295b07de32a1f61cac6411a02b1c815b3f84786b74e1380d8ce3b98adc0
MD5 95dbe2d016648508d5e792c485b14e91
BLAKE2b-256 8d8ea6c960f06252ca7e3a1b826e547c56939092ac4ed6203ad05f3d72ff42e0

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyflasc-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 877.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for pyflasc-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 33b6345243f42dcd948cf20fecb0673ac817bdac5baaa5f8b8b81785ce03a8f1
MD5 01a2824294f66b9d298bf5ed501829f0
BLAKE2b-256 b1aada5cf50c9240ceb551560a632fec9b848c42b63a3da5e31eda5285521f50

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa393b8b502d2272c717e6e57931ec9182120f7abccaf26decab374828b86bc6
MD5 9efd9a6adce16bb8e9ae5b24e19416ea
BLAKE2b-256 df0862066f5d8d04bc1d6999eb83c316fc30841e88e07f485917fe60329a4180

See more details on using hashes here.

Provenance

File details

Details for the file pyflasc-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyflasc-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c15133cbac00a223db963ca83a689a62129cb9931630154307af62ed0e4de5e6
MD5 11dabe0e83c68b61337206e238cedc5a
BLAKE2b-256 b8936f65923c24a190a7377ca8e7078545c8008bd2d569390ecee6459e1e8fea

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page