[](https://badge.fury.io/py/pyflasc)
[](https://github.com/vda-lab/pyflasc/actions/workflows/Wheels.yml)
# FLASC: Flare-Sensitive Clustering
FLASC - Flare-Sensitive Clustering, adds an efficient post-processing step to
the [HDBSCAN\*](https://github.com/scikit-learn-contrib/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.
```python
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 Notebooks
A notebook demonstrating how the algorithm works is available at [How FLASC
Works](https://nbviewer.org/github/vda-lab/pyflasc/blob/master/notebooks/How%20FLASC%20Works.ipynb).
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:
```bash
pip install pyflasc
```
For a manual install of the latest code directly from GitHub:
```bash
pip install --upgrade git+https://github.com/vda-lab/pyflasc.git#egg=pyflasc
```
Alternatively download the package, install requirements, and manually run the
installer:
```bash
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:
```bibtex
@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](http://joss.theoj.org/papers/10.21105/joss.00205).
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
```bibtex
@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
```bibtex
@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.
Raw data
{
"_id": null,
"home_page": "https://github.com/vda-lab/pyflasc",
"name": "pyflasc",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Jelmer Bot",
"author_email": "jelmer.bot@uhasselt.be",
"download_url": "https://files.pythonhosted.org/packages/73/7d/440053c4aa2f925e714659eee64bce2eb70d618152d98cc53ae7a8626512/pyflasc-0.1.3.tar.gz",
"platform": null,
"description": "[](https://badge.fury.io/py/pyflasc)\n[](https://github.com/vda-lab/pyflasc/actions/workflows/Wheels.yml)\n\n# FLASC: Flare-Sensitive Clustering\n\nFLASC - Flare-Sensitive Clustering, adds an efficient post-processing step to\nthe [HDBSCAN\\*](https://github.com/scikit-learn-contrib/hdbscan) density-based\nclustering algorithm to detect branching structures within clusters.\n\nThe algorithm adds two parameters that may need tuning with respect to\nHDBSCAN\\*, but both are intuitive to tune: minimum branch size and branch\nselection strategy.\n\n## How to use FLASC\n\nThe FLASC package is closely based on the HDBSCAN* package and supports the same\nAPI, except sparse inputs, which are not supported yet.\n\n```python\nfrom flasc import FLASC\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\ndata = np.load('./notebooks/data/flared_clusterable_data.npy')\nclusterer = FLASC(min_cluster_size=15)\nclusterer.fit(data)\ncolors = sns.color_palette('tab10', 10)\npoint_colors = [\n sns.desaturate(colors[l], p)\n for l, p in zip(clusterer.labels_, clusterer.probabilities_)\n]\nplt.scatter(data[:, 0], data[:, 1], 2, point_colors, alpha=0.5)\nplt.axis('off')\nplt.show()\n```\n\n\n\n## Example Notebooks\n\nA notebook demonstrating how the algorithm works is available at [How FLASC\nWorks](https://nbviewer.org/github/vda-lab/pyflasc/blob/master/notebooks/How%20FLASC%20Works.ipynb).\nThe other notebooks demonstrate the algorithm on several data sets and contain\nthe analyses presented in our paper.\n\n## Installing\n\nBinary wheels are available on PyPI. Presuming you have an up-to-date pip:\n\n```bash\npip install pyflasc\n```\nFor a manual install of the latest code directly from GitHub:\n\n```bash\npip install --upgrade git+https://github.com/vda-lab/pyflasc.git#egg=pyflasc\n```\n\nAlternatively download the package, install requirements, and manually run the\ninstaller:\n\n```bash\nwget https://github.com/vda-lab/pyflasc/archive/main.zip\nunzip main.zip\nrm main.zip\ncd flasc-main\n\npip install -t .\n```\n\n## Citing\n\nA scientific publication of this algorithm is available on Arxiv:\n\n```bibtex\n@misc{bot2023flasc,\n title={FLASC: A Flare-Sensitive Clustering Algorithm: Extending HDBSCAN* for Detecting Branches in Clusters}, \n author={D. M. Bot and J. Peeters and J. Liesenborgs and J. Aerts},\n year={2023},\n eprint={2311.15887},\n archivePrefix={arXiv},\n primaryClass={cs.LG}\n}\n```\n\nThis FLASC algorithm and software package is very closely related to McInnes et\nal.'s HDBSCAN\\* software package. If you wish to cite the HDBSCAN\\* package in a\nscientific publication, please use their [Journal of Open Source Software\narticle](http://joss.theoj.org/papers/10.21105/joss.00205).\n\n L. McInnes, J. Healy, S. Astels, *hdbscan: Hierarchical density based clustering*\n In: Journal of Open Source Software, The Open Journal, volume 2, number 11.\n 2017\n\n```bibtex\n@article{mcinnes2017hdbscan,\n title={hdbscan: Hierarchical density based clustering},\n author={McInnes, Leland and Healy, John and Astels, Steve},\n journal={The Journal of Open Source Software},\n volume={2},\n number={11},\n pages={205},\n year={2017}\n}\n```\n\nTo reference their high performance algorithm please cite their paper in ICDMW\n2017 proceedings.\n\n McInnes L, Healy J. *Accelerated Hierarchical Density Based Clustering*\n In: 2017 IEEE International Conference on Data Mining Workshops (ICDMW), IEEE, pp 33-42.\n 2017\n\n```bibtex\n@inproceedings{mcinnes2017accelerated,\n title={Accelerated Hierarchical Density Based Clustering},\n author={McInnes, Leland and Healy, John},\n booktitle={Data Mining Workshops (ICDMW), 2017 IEEE International Conference on},\n pages={33--42},\n year={2017},\n organization={IEEE}\n}\n```\n\n## Licensing\n\nThe FLASC package has a 3-Clause BSD license.\n",
"bugtrack_url": null,
"license": "3-Clause BSD",
"summary": "Flare-Sensitive Clustering based on HDBSCAN*.",
"version": "0.1.3",
"project_urls": {
"Code": "https://github.com/vda-lab/pyflasc",
"Homepage": "https://github.com/vda-lab/pyflasc",
"Issue tracker": "https://github.com/vda-lab/pyflasc/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6bbe94a4d047b2051884c76a1f5b098fa5beb191b6f77ba3b485cda8328eb0e0",
"md5": "5bbbc96ebb5679047d35772082c177e9",
"sha256": "8ddb3670d795c09041a0a743ed5e045468b5895bc85fecf4963204998add2c3e"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "5bbbc96ebb5679047d35772082c177e9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 948684,
"upload_time": "2024-08-15T12:11:21",
"upload_time_iso_8601": "2024-08-15T12:11:21.626950Z",
"url": "https://files.pythonhosted.org/packages/6b/be/94a4d047b2051884c76a1f5b098fa5beb191b6f77ba3b485cda8328eb0e0/pyflasc-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "063e7e5f41f67bc7670518786da389048aca872b83e3a24ffb456588081d0c17",
"md5": "e642ba6385334526b602d26eb98661d4",
"sha256": "61b742e92dd2cc5ba2f467d015b42f651f6da06cb2f8bb6461659b12397cbef6"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "e642ba6385334526b602d26eb98661d4",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 4677877,
"upload_time": "2024-08-15T12:11:23",
"upload_time_iso_8601": "2024-08-15T12:11:23.519259Z",
"url": "https://files.pythonhosted.org/packages/06/3e/7e5f41f67bc7670518786da389048aca872b83e3a24ffb456588081d0c17/pyflasc-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "570a4402ea1b301db3c40ed5ad56d65f415a10131e5a6bca851b84bd4c56548a",
"md5": "f50c4b33503d876bbeb8b1233f4c1058",
"sha256": "8b0014572694749b8a42956c0d99db058f7d3792c2c94930d83932a582bad892"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "f50c4b33503d876bbeb8b1233f4c1058",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 876114,
"upload_time": "2024-08-15T12:11:25",
"upload_time_iso_8601": "2024-08-15T12:11:25.018845Z",
"url": "https://files.pythonhosted.org/packages/57/0a/4402ea1b301db3c40ed5ad56d65f415a10131e5a6bca851b84bd4c56548a/pyflasc-0.1.3-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97caabb60b80164fb8dca112baaf655b6a6e6623a5d0eca1e5bbfcb268aef6eb",
"md5": "0da78a300d2bf93cb6715ffd5b70ed46",
"sha256": "a2efd8a22ac85d68bbe96080740c5697c5d3e52bc57fdeab57013cbce00f18ea"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp311-cp311-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "0da78a300d2bf93cb6715ffd5b70ed46",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 949243,
"upload_time": "2024-08-15T12:11:26",
"upload_time_iso_8601": "2024-08-15T12:11:26.944796Z",
"url": "https://files.pythonhosted.org/packages/97/ca/abb60b80164fb8dca112baaf655b6a6e6623a5d0eca1e5bbfcb268aef6eb/pyflasc-0.1.3-cp311-cp311-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "332eab11fe5d39097010c23538df7216cf427c480b0007317819c1dc086a6fed",
"md5": "86755e55611e7f5814c3ebac1764d608",
"sha256": "f3c2f2972e8f23641dcdf8ca9dc6be9522e7ef75657e11c0c3e7ec55d8452498"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "86755e55611e7f5814c3ebac1764d608",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 4966956,
"upload_time": "2024-08-15T12:11:28",
"upload_time_iso_8601": "2024-08-15T12:11:28.956755Z",
"url": "https://files.pythonhosted.org/packages/33/2e/ab11fe5d39097010c23538df7216cf427c480b0007317819c1dc086a6fed/pyflasc-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "85cca13830d4f75140aa5ec0ce4c1af441a9c4ad6786301ad5915bf2a7ddbb8d",
"md5": "14e9dc5ea2bae12204669050239db977",
"sha256": "25471757764a544789b171a62745a6f5bcd7ed593cd2b29797212223b1c221c0"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "14e9dc5ea2bae12204669050239db977",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 875827,
"upload_time": "2024-08-15T12:11:31",
"upload_time_iso_8601": "2024-08-15T12:11:31.966588Z",
"url": "https://files.pythonhosted.org/packages/85/cc/a13830d4f75140aa5ec0ce4c1af441a9c4ad6786301ad5915bf2a7ddbb8d/pyflasc-0.1.3-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1465db038d6c3fc2f94f9490f453609e21bea1b4e39cf3f52c379fd18b883ae1",
"md5": "6b4bf5765b363f29efcca7c64b27f9dd",
"sha256": "95402533e9e14b390c3b96d3a23f72f539fbab6198bf6466f673f2d0cdc1d7f1"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "6b4bf5765b363f29efcca7c64b27f9dd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 950544,
"upload_time": "2024-08-15T12:11:33",
"upload_time_iso_8601": "2024-08-15T12:11:33.158210Z",
"url": "https://files.pythonhosted.org/packages/14/65/db038d6c3fc2f94f9490f453609e21bea1b4e39cf3f52c379fd18b883ae1/pyflasc-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "46b068143259ff892b4f709656380928853cfd61fb833ceb363bdb66379f9e13",
"md5": "81e8854d18820353234d6460716842c4",
"sha256": "324ce2432b6e8077241ebd18dd095f314a29c202b42b0a12a89b129dc62d7dbe"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "81e8854d18820353234d6460716842c4",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 4693318,
"upload_time": "2024-08-15T12:11:35",
"upload_time_iso_8601": "2024-08-15T12:11:35.242397Z",
"url": "https://files.pythonhosted.org/packages/46/b0/68143259ff892b4f709656380928853cfd61fb833ceb363bdb66379f9e13/pyflasc-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4fed40c6d58b810281e1f1433028976560453c231c48d0a886c69649e747f687",
"md5": "1e8b98c83a57e8a95f164339ff575492",
"sha256": "6a43bac72b023d1b81aa96feee9452efa44ccb2f32b11d11b8f42abdb48dbe6c"
},
"downloads": -1,
"filename": "pyflasc-0.1.3-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "1e8b98c83a57e8a95f164339ff575492",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 879811,
"upload_time": "2024-08-15T12:11:37",
"upload_time_iso_8601": "2024-08-15T12:11:37.369996Z",
"url": "https://files.pythonhosted.org/packages/4f/ed/40c6d58b810281e1f1433028976560453c231c48d0a886c69649e747f687/pyflasc-0.1.3-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "737d440053c4aa2f925e714659eee64bce2eb70d618152d98cc53ae7a8626512",
"md5": "5a90eee1c46c82442f72bbcf54792872",
"sha256": "e577fb729d92637f27622cde6b29ca49b121bc452dfcdab01dc9af183a335afb"
},
"downloads": -1,
"filename": "pyflasc-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "5a90eee1c46c82442f72bbcf54792872",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 239602,
"upload_time": "2024-08-15T12:11:38",
"upload_time_iso_8601": "2024-08-15T12:11:38.437926Z",
"url": "https://files.pythonhosted.org/packages/73/7d/440053c4aa2f925e714659eee64bce2eb70d618152d98cc53ae7a8626512/pyflasc-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-15 12:11:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vda-lab",
"github_project": "pyflasc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.20"
],
[
"<",
"3"
]
]
},
{
"name": "scipy",
"specs": [
[
"<",
"2"
],
[
">=",
"1.9"
]
]
},
{
"name": "scikit-learn",
"specs": [
[
"<",
"2"
],
[
">=",
"1.1"
]
]
},
{
"name": "joblib",
"specs": [
[
"<",
"2"
],
[
">=",
"1.1"
]
]
},
{
"name": "hdbscan",
"specs": [
[
"<",
"1"
],
[
">=",
"0.8"
]
]
}
],
"lcname": "pyflasc"
}