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 is available on Arxiv:

@misc{bot2023flasc,
  title={FLASC: A Flare-Sensitive Clustering Algorithm: Extending HDBSCAN* for Detecting Branches in Clusters}, 
  author={D. M. Bot and J. Peeters and J. Liesenborgs and J. Aerts},
  year={2023},
  eprint={2311.15887},
  archivePrefix={arXiv},
  primaryClass={cs.LG}
}

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.3.tar.gz (239.6 kB view details)

Uploaded Source

Built Distributions

pyflasc-0.1.3-cp311-cp311-win_amd64.whl (875.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyflasc-0.1.3-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.3-cp311-cp311-macosx_10_9_x86_64.whl (949.2 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyflasc-0.1.3-cp310-cp310-win_amd64.whl (876.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyflasc-0.1.3-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.3-cp310-cp310-macosx_10_9_x86_64.whl (948.7 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyflasc-0.1.3-cp39-cp39-win_amd64.whl (879.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyflasc-0.1.3-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.3-cp39-cp39-macosx_10_9_x86_64.whl (950.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyflasc-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e577fb729d92637f27622cde6b29ca49b121bc452dfcdab01dc9af183a335afb
MD5 5a90eee1c46c82442f72bbcf54792872
BLAKE2b-256 737d440053c4aa2f925e714659eee64bce2eb70d618152d98cc53ae7a8626512

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyflasc-0.1.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 875.8 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 25471757764a544789b171a62745a6f5bcd7ed593cd2b29797212223b1c221c0
MD5 14e9dc5ea2bae12204669050239db977
BLAKE2b-256 85cca13830d4f75140aa5ec0ce4c1af441a9c4ad6786301ad5915bf2a7ddbb8d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3c2f2972e8f23641dcdf8ca9dc6be9522e7ef75657e11c0c3e7ec55d8452498
MD5 86755e55611e7f5814c3ebac1764d608
BLAKE2b-256 332eab11fe5d39097010c23538df7216cf427c480b0007317819c1dc086a6fed

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a2efd8a22ac85d68bbe96080740c5697c5d3e52bc57fdeab57013cbce00f18ea
MD5 0da78a300d2bf93cb6715ffd5b70ed46
BLAKE2b-256 97caabb60b80164fb8dca112baaf655b6a6e6623a5d0eca1e5bbfcb268aef6eb

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyflasc-0.1.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 876.1 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8b0014572694749b8a42956c0d99db058f7d3792c2c94930d83932a582bad892
MD5 f50c4b33503d876bbeb8b1233f4c1058
BLAKE2b-256 570a4402ea1b301db3c40ed5ad56d65f415a10131e5a6bca851b84bd4c56548a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61b742e92dd2cc5ba2f467d015b42f651f6da06cb2f8bb6461659b12397cbef6
MD5 e642ba6385334526b602d26eb98661d4
BLAKE2b-256 063e7e5f41f67bc7670518786da389048aca872b83e3a24ffb456588081d0c17

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8ddb3670d795c09041a0a743ed5e045468b5895bc85fecf4963204998add2c3e
MD5 5bbbc96ebb5679047d35772082c177e9
BLAKE2b-256 6bbe94a4d047b2051884c76a1f5b098fa5beb191b6f77ba3b485cda8328eb0e0

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyflasc-0.1.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 879.8 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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6a43bac72b023d1b81aa96feee9452efa44ccb2f32b11d11b8f42abdb48dbe6c
MD5 1e8b98c83a57e8a95f164339ff575492
BLAKE2b-256 4fed40c6d58b810281e1f1433028976560453c231c48d0a886c69649e747f687

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 324ce2432b6e8077241ebd18dd095f314a29c202b42b0a12a89b129dc62d7dbe
MD5 81e8854d18820353234d6460716842c4
BLAKE2b-256 46b068143259ff892b4f709656380928853cfd61fb833ceb363bdb66379f9e13

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyflasc-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 95402533e9e14b390c3b96d3a23f72f539fbab6198bf6466f673f2d0cdc1d7f1
MD5 6b4bf5765b363f29efcca7c64b27f9dd
BLAKE2b-256 1465db038d6c3fc2f94f9490f453609e21bea1b4e39cf3f52c379fd18b883ae1

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