Skip to main content

No project description provided

Project description

Tribal

Transductive inference-based clustering algorithms Python package

About

Tribal is a Python package containing three clustering algorithms based on transductive inference for partially labeled data. The goal of the algorithms is to enable determining the assignment of input data to specific clusters based on existing labeled data. Two of the proposed algorithms are based on graph constructions derived from the input data, while the third relies solely on neighborhood proximity. The implementations emphasize both computational efficiency and the ability for users to customize parameters. The package also features an implementation of visualization methonds for two-dimensional or three-dimensional data. The package was designed in a modular manner to facilitate future extensions and updates. Additionally, the provided documentation and a set of practical examples support users in quickly deploying the algorithms in real-world projects.

Authors and Contributors

Authors and Maintainers: Wojciech Grabias, Krzysztof Sawicki
Guidance and contributions: prof. Marek Gągolewski

How to Install

To install via pip (see PyPI):

pip install tribal

Example of use

All implemented algorithms can be imported via the path transatlantic.transductive_clustering.
These are the classes MSTL, GMKNN, and TDBSCAN.

import tribal
from tribal.transductive_clustering import MSTL , GMKNN , TDBSCAN

alg1 = MSTL()
alg2 = GMKNN(k=7)
alg3 = TDBSCAN(eps=0.1, k=4, new_clusters=False)

The process is analogous to the scikit-learn package and is identical for each of the implemented algorithms.
The user is required to provide data points as a list of lists or any other structure that can be cast to an object of the class np.ndarray, as well as initial labels as a one-dimensional list of integers (with the value -1 used to indicate missing labels).
The algorithm is executed on the provided data using the fit() method.

X = [[...] , [...] , ...] # Input data
y = [...] # Initial labels

alg1.fit(X , y)

To obtain the output labels of the algorithm, you should refer to the labels_ attribute.

final_labels = alg1.labels_

The two aforementioned steps can be combined into a single step by calling the fit_predict() method.

X = [[...] , [...] , ...] # Input data
y = [...] # Initial labels

final_labels = alg1.fit_predict(X , y)

Additional functionalities related to algorithms

In the case of graph algorithms, it is possible to gain insight into the algorithm's execution by generating a graph that represents the graph responsible for the specific stages of the program.

alg1.draw_transitional_graph("mst")
alg1.draw_result_graph()

In the case of the first algorithm, a minimum spanning tree is generated based on the initial data. For the second algorithm, the following options are available:

  • knn - k-nearest neighbors graph
  • mknn - mutual k-nearest neighbors graph
  • informative edges - represents a stage aimed at removing insignificant edges
alg2.draw_transitional_graph("knn") # Options : knn, gmknn ,informative_edges
alg2.draw_result_graph()

Testing data

During the development of the project, the algorithms were tested on data from the Clustering Benchmark project.

License

Tribal Package for Python

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License Version 3, 19 November 2007, published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License Version 3 for more details. You should have received a copy of the License along with this program. If this is not the case, refer to https://www.gnu.org/licenses/.

References

Gagolewski M., genieclust: Fast and robust hierarchical clustering, SoftwareX 15, 2021, 100722. DOI: 10.1016/j.softx.2021.100722. https://genieclust.gagolewski.com/.

Gagolewski M., A framework for benchmarking clustering algorithms, SoftwareX 20, 2022, 101270. DOI: 10.1016/j.softx.2022.101270. https://clustering-benchmarks.gagolewski.com/.

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

tribal-0.1.7.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tribal-0.1.7-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

tribal-0.1.7-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

tribal-0.1.7-cp313-cp313-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

tribal-0.1.7-cp313-cp313-macosx_10_13_universal2.whl (4.6 MB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

tribal-0.1.7-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12Windows x86-64

tribal-0.1.7-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

tribal-0.1.7-cp312-cp312-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

tribal-0.1.7-cp312-cp312-macosx_10_13_universal2.whl (4.6 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

tribal-0.1.7-cp311-cp311-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11Windows x86-64

tribal-0.1.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

tribal-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

tribal-0.1.7-cp311-cp311-macosx_10_9_universal2.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

tribal-0.1.7-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

tribal-0.1.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

tribal-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

tribal-0.1.7-cp310-cp310-macosx_10_9_universal2.whl (4.6 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file tribal-0.1.7.tar.gz.

File metadata

  • Download URL: tribal-0.1.7.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tribal-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ef74b597aa91625d31c77e7452dad17915978e2ba2fc3ed0f49aa281277fa204
MD5 5cddd27d98801e9a5757a5a6e092cd7f
BLAKE2b-256 cd385bc643363ab99f2285b2e5f6de477d1dd1c907ed8f2993ce60aee9233a0a

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: tribal-0.1.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tribal-0.1.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 829c735c0aac8664bba204270cb4e40e03b4d8d7a00a83e78b25a097f003972d
MD5 03298762232e67e29520c1cb152708b3
BLAKE2b-256 e4df88f3ffaaced56587bf3312d1bd91a16c885c5c52886a539c320ac0d7f6f6

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a639617ec4a98192339e90753639af251e765492c85b0ce06912617748ec6243
MD5 fdf6c2a12176c879f6fd831bce291370
BLAKE2b-256 1cee8ee5f09aba8adf70ef04ca4acfcb4a2e9adde02d01ceb7bcc32b7e8fc7fb

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8b40071dd1a80dd122dfb02e0d85d37d77570e99932e5d57aaeaea83a39ed84b
MD5 c6a34a96a03c7b4bf037c18e742b83c7
BLAKE2b-256 b12a2fa948d5eea53b36da6182c2428170438327302fc659b9dd4bad5b42eab6

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 52ec6974edea20c95662a591d7caa2594a3c74f180b759866e4c0ed6bc990ef2
MD5 3dad4b10eeda4152ee8fa1abc747e913
BLAKE2b-256 4ec45262075b9e5b1996db51afd39d41ed5eb08aeca1a9e64b108bf8ab8e8ac7

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: tribal-0.1.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tribal-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cf83e444839da68e8e12aaa0704c43a750229a4711435814b5e967b0fd5381a1
MD5 dcca126260c7ba03bb8c082a46bb0fa8
BLAKE2b-256 506f4c8a468a78e621e9ffacb6802812f557a9649a6196cc3aa474884d3d9379

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e260f49c3e5eb0627ec28a151df6cef82cea221f3a977b3727852db000ddba66
MD5 4ff6da02e01b4e1ff0dbf140dfde099d
BLAKE2b-256 358e66e42a6fd6e4dafde622fc5ce57f61b88aeacd7d6e3d9af44f590ef415dd

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 da4e40abd45ee13328f24340ae5cd84f8960ba057b7da0ad0f23a3a0da2a85ab
MD5 c54a6779316ac4359dcc899e177aecc3
BLAKE2b-256 7c55cc48c733cfbf20210cba5b568d759eea35714ed55e5e5a5372a67fb24c07

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 97805537832253fd38fc78f004da788bbd7631cd12c054a53e439bbe7b9ac1aa
MD5 e81567da0e15c7dbd77bb619bb326c63
BLAKE2b-256 ccda17aa33d3ce93fff1e1a5fe6fba34fa495669f1c8d621cd0a28bda2e5f313

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: tribal-0.1.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tribal-0.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2ff6ae5c521baaeb5f8e1324f1db07c542d3e26597055f08da126a3bd4e8d5f1
MD5 e02f4ac600dcdb47d87efb5025fbce01
BLAKE2b-256 84ce7c8f8820d125938f96123cde7f37916200e06119946f322ea5074383d326

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 12aba402ae3ac8cfc594b48c386ecc46da40428425425425c3659e3bfa4aafaa
MD5 07bf05e76ba50af19633cf292379461c
BLAKE2b-256 2522535832894dd6f55533ccefdce730b8acfff1c773347ffd5e7665604740e2

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 aec168f060ee3d5e11bcd04dc9134dece4780b7de2f7ace94d9c85b6a44215bd
MD5 ecdd9fc117952d06386a47aa5ac596e4
BLAKE2b-256 e1f6fba9b8019537d793f551949ae22dd72931fbf713ee8a0848ac6d70138050

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 adeea00e40552c8dc64c31462ccbaa479e0deb6c7e686b0cd186b8fa04db7b49
MD5 8ee796f75161e9860aaf3299d04200a5
BLAKE2b-256 622d42a7bbedd4c5f17a7debb800f3d810af6639fd8da81a70b509e43546b023

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: tribal-0.1.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tribal-0.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5a89c984623eec7bd96808ffe76550e52d666f08ab7f8a85fafbe17d8f0f0b00
MD5 3ff73db4e5fa8d9db78988f0b58121da
BLAKE2b-256 1c05ace8bee11d9cbd401a8f4163c8d0c49a79f1ee5a6ac2dedcd645a7390b17

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a38d72635d5a5e25f52a5396621ca7b18d109fdf5275c2abacd33f37b0ab3b92
MD5 6e8d5b87482fd82d14afd03a87c066ee
BLAKE2b-256 f6eaa29a69cb204c2f6e2af7259008d81da0335cbd80af72db795efa6eff3455

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e6fde227e8f80442b8b32d779bd7d38f5ff1024ef9a2fe4b65cda496f73bd14d
MD5 3b49f8e0448d2513591afe8db1dc4ec0
BLAKE2b-256 cdf74d080f54bf87a44ce14759c047ffe2f793ad1b1205c5fdd4ffb0aae81aa6

See more details on using hashes here.

File details

Details for the file tribal-0.1.7-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tribal-0.1.7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 44195925dbf80524b57ef811e6416fa21ebf7ad8500c9b13048fa6ece7155175
MD5 b9c4cdeac81d588e66049585781671f8
BLAKE2b-256 31f24394185d42c2c377d630f8af685beb2d9a213691dcea34b622560f012463

See more details on using hashes here.

Supported by

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