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 hashes)

Uploaded Source

Built Distributions

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

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 hashes)

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 hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

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 hashes)

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 hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

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 hashes)

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 hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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