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.0.6.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.0.6-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

tribal-0.0.6-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.0.6-cp313-cp313-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

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

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

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

Uploaded CPython 3.12Windows x86-64

tribal-0.0.6-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.0.6-cp312-cp312-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

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

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

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

Uploaded CPython 3.11Windows x86-64

tribal-0.0.6-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.0.6-cp311-cp311-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

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

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

Uploaded CPython 3.10Windows x86-64

tribal-0.0.6-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.0.6-cp310-cp310-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

tribal-0.0.6-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.0.6.tar.gz.

File metadata

  • Download URL: tribal-0.0.6.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.0.6.tar.gz
Algorithm Hash digest
SHA256 a664688a388a8f4ffaa63c1d4ccb03215a0cc8409ca104c4348563a4da939968
MD5 24e401563dfd360a560d6c0bb90f2518
BLAKE2b-256 f6f8776864c65f2876b9fc62bd1e531575b6b44af48b6682508a4db3ecb09e14

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.0.6-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.0.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9bcefa0d0e83063f563d84619152c7368d0a3081866a4bb3a410bc96ad8a654c
MD5 91e06eab8d7717b09bbcbcb5c459a620
BLAKE2b-256 d8553e017ff4e7efc1e8779a880d1567dc5a1134a10791737a439cf11979d854

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b10d11545557abf0538b88703dd9607453c5bff6432b70cb2f0135b17465c0bb
MD5 88fcd31bced7e3dfbf192a6f5bac5ade
BLAKE2b-256 fe71f1a48401d40f5a4a329c929e5ad49bc80e96f6e3390b8ee5e34db20cc6ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f8966eae025b3033b5f8e87eca5afa47bcd8f0c8517bdb8db04bf1156cc9e885
MD5 b320c6a07b253578d2de16f3ee3137df
BLAKE2b-256 e3d6688b87c6f7d3ec38634c4b2196f2c5ff68e18785cc63927bbc6cc0081d7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 b7ec7ee5defd334a71d75db2f65bb2de943920e97ea348a93767ebc3a59306a7
MD5 675dfe4b6b03e303623ac7f9d1a34f6f
BLAKE2b-256 1bc47702b80a67c0f391b5bea99a3794b285deba63b269abb7069b6601167fc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.0.6-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.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7188424a0b5df17ead9ead3cf97ca84f78b0fbc4a0100ee138483573fbd3e84d
MD5 ef79120295f769ccef384aad66b32379
BLAKE2b-256 af439df0c9cd6e2a946c6febe0a8fa2ba85cfc30ca277ee4af89b7ee636f424b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9dcd66c7d099c7dad4ce8eb938fa97b4cba2000f2ce347b80c45c45091056f19
MD5 c664a5992a9bcf79098a996617796fa2
BLAKE2b-256 3e6d97c5ad7f579363fcabc371c77b787b6539500effe4350bebc9d39a28785c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c4e46b63c68c2de4f96a14f23a92613ec01fcb746476ea54a90e4f689dbc0d70
MD5 5cab9450ce8e4a3a7f3e1ba348eb9afa
BLAKE2b-256 2bbb80049cf3df6ed691615223bc5d2ed6b5912291823d3d96fb40df142fd379

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 73aeae9a045ffbf6f38d0540ed502602e18a3392d9ab92fecbf8a6169553c29f
MD5 9e06b678cd91bb547016f710c2ccd4d6
BLAKE2b-256 f0761783c89f24cb4458047bf50f1086e785e2f03b7ce621529c35e56963dc6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.0.6-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.0.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8242d41e9e86ef95c0cf68f8c66f16cebd1392a071e2965c111dc2a613ce6765
MD5 74e8d2c99d2c1054e6e57c8b3419f6cb
BLAKE2b-256 61b1897e4bcbc0a00cc5eedf12a07279f4bc321effad2b7b2c47b40a2b0331f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2ae6ae4cb3ac6df031979685cdddec050a8eeb8cb887a25b835a586e48f92d4f
MD5 0a9ea4e705db96d19bf3a37cf686f8c5
BLAKE2b-256 c861ff15815267b4ac7beeca279643f54473613ad05de317b1bb8e7c4ec3eac2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4fa446f0a49163cb89c55f99b49bfbc091184d62f8ddaa91e12802ddf7249579
MD5 679c0de5ccf595f3f506281cf30f8fe7
BLAKE2b-256 3cb2d0e96d8f151b948337fe31e807830af54fa3a687decbf9f38094e8743c84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0f5cc9cabc6571a45929682cad1d75bd9e3fe5217f1ba77e858d51c7b9487d16
MD5 60f4751dd6970f4f87646cb84b95ac6c
BLAKE2b-256 075390d7c62335dc535f5a0a7417fe16f773112d10f0d2d4a00e2fb94336481a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.0.6-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.0.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d0182d2e2414bf210286b5ebd56112e67669f65d22922fc160e6fb682f440d5b
MD5 2237edd0b18a20083c6cb55f730a3183
BLAKE2b-256 8d0258b6fc590e32e25be62b12991b746366e42c5f10c6852adff00fc542d755

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aa8d840e31d0da3841191c24fa92073ecc9a7149f6831b7ec237e6739a4f8bbe
MD5 faf1ae5458475b12104ac6d63258ece9
BLAKE2b-256 5dd57bd06109a18fdda78cf1cb1c96b5f1a5bafcb3c796f5983e1be5c3214345

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 16948c442a7e3fbef390e0a0e3fbc49c53bc634b42a08545411b357b2e37ac76
MD5 cf35451bd8336ef6c9c9aafd4dc28145
BLAKE2b-256 92ae03362f1534515f7c605b639e7dcbc5697c47007349f16ac4524e5d4965fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.0.6-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fc5c624762b2e297b42f025fbe131e591856fd57329dd7a031793c4daf0093d0
MD5 b114f062b2d391c0f0eb53dc2d05a67b
BLAKE2b-256 bf80820e0dfe7026656c509b056a7fd1e3103637cbbb8795a44da5df57ebaa3e

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