Skip to main content

No project description provided

Project description

Tribal

Transductive inference-based clustering algorithms Python package

Currently existing under the name tribal-temp, pending PEP-541 approval from PyPi

About

Transatlantic 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-temp

The package requires Python 3.8+ with dependiences listed bellow:

  • Cython
  • numpy
  • scipy
  • matplotlib
  • scikit-learn
  • networkx

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

Transatlantic 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_temp-0.0.1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distributions

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

tribal_temp-0.0.1-cp313-cp313-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.13Windows x86-64

tribal_temp-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

tribal_temp-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

tribal_temp-0.0.1-cp313-cp313-macosx_10_13_universal2.whl (4.6 MB view details)

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

tribal_temp-0.0.1-cp312-cp312-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.12Windows x86-64

tribal_temp-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

tribal_temp-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

tribal_temp-0.0.1-cp312-cp312-macosx_10_13_universal2.whl (4.6 MB view details)

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

tribal_temp-0.0.1-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

tribal_temp-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

tribal_temp-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

tribal_temp-0.0.1-cp311-cp311-macosx_10_9_universal2.whl (4.5 MB view details)

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

tribal_temp-0.0.1-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

tribal_temp-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

tribal_temp-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

tribal_temp-0.0.1-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_temp-0.0.1.tar.gz.

File metadata

  • Download URL: tribal_temp-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tribal_temp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5123ef338ce1080e64e39f988b42df819d4daca8f3e4a0ab368b8af497130e5c
MD5 05a4cac0d82b1d9c760dd7a21b8d8abd
BLAKE2b-256 b70287829530a98ea3ac8464960c69ae2f11bca57699ecdb003e31f0c4ee27fd

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 744f11c8833a52f847391909ff3ceb770b93f296c00a521abed98ca7e1593c15
MD5 a5de184a53eaa3d149fe00a12ada4a8b
BLAKE2b-256 9da71be9a37117d7b21ad567284ae4114b83bec978acf0dcb3bcb43aff79acc2

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9365e7b918dbb4810db7063f0a146051a25707b79d4bf7066db46938a3617754
MD5 cede7fb874fbdc7caf53408380e6c4d9
BLAKE2b-256 65ba04cc899fc4f25ded44f2950119f47fcb6487bb3059f133aa6b0c0ef2ce24

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 68e58c1ee475e9737261af4eb412b874a4cd01c3074ecef23216394e74b80897
MD5 e260d8025649668e2df3d31f19f3f1b6
BLAKE2b-256 030649b81f534ca667b1a6416b3d1b512a6991ace96a4c86e2070d9d9c76e164

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 ef9fba32231c94805bb3b84e3ef05d99d34d1e66ea606851ca3d5605d3a32c1e
MD5 f9bfa0f7008d8db82085c01693c9826f
BLAKE2b-256 f6c10863336cb59b119ef363f44d1f50ccb592747c8157751337c744dcd37b50

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c8e6562d357e1076e55d911adf543bb9aa6142c45efd2b5afee188f63a3fca73
MD5 aff1381a2369b8ac6226c2fda1067a49
BLAKE2b-256 2ed62f3abdec06898ac7db9ce8fa3a255d75fed3844687574538313442f8be91

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e0e165f0412ed424d403ec6509e62a4c493a3856b026b9fe2ce7d747798a745
MD5 7fd7109225bbc9d98fc8bcf0bd74db59
BLAKE2b-256 0577af6b53bee7e79a9d6548ea9467d4885762b625741af68bce4bd8e36ce0ed

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 4b265c608852b7f0766b4dbe5ea249235a37d430e1632cb9a719fd6b8e6db785
MD5 e0f1bb9ae669e1c3b3d47c65a7d909f7
BLAKE2b-256 3c0ba529efc2517c4973d95839e8f037af76f4d3348e73636738115f5d2c0f87

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 61410d06be7c675b89a8c8c316c93195cc8b5b62a9e6f1d238122e203bc99dc3
MD5 74ffd104c5e6aa119114c050c8a27dae
BLAKE2b-256 9618a2420c4016c354a8d3129008befc29676f3638a954613d5415b8bba4a73f

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 51ee535beb093276d7e91c0cf16d012a517445c3354135313f071477899b5fef
MD5 f838e559d181df1729f1c7652db59f61
BLAKE2b-256 b74d6c532acd9cde9850f3038701308e46411932c705c76dcfcc798b07697116

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4f32ebe5f99aaf3c0fa8aec2bf550209ebad730ec3b4bf14e0b5e56ab0096c3
MD5 b5b01b61b60c1b877f3aac53b0d8e4e8
BLAKE2b-256 1188d073d2a3290b439d6870b7b7d03f9bfdafb51ee14a6e9d4b971df7051132

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 55358e22010e2d31504824d232ed6caa0dbad5b3409bef9276907365620943d1
MD5 a2bb7806ae92bb4a37c30a51fcdfc597
BLAKE2b-256 8d2e2d2edc4a4f74813ac27bd2d0cb4fd4d9277ca8fe1f0a6a1b00fae129f02c

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2fed33dbeb67a1d37061d0ed10e7b5362aa7c305140c57e32d3dcc07d742d317
MD5 8ac9cf9f1f377ec0cec262f69842df04
BLAKE2b-256 2c7f6f0107429d8bff8162e767e25e1bf2900ddce5524364e6eff451247bdcd7

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b1e8127da08ad904cbbee0d819dddc6b890a11387b42ea2e2e7a8347079b5367
MD5 945211fdf9cd5d8bc78cee41a51e07d8
BLAKE2b-256 04b03ce9da13c44716155b95ff9fe88e65b49ae2ffbd558f00874cfea4671042

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e87cdd8fa1d829ea8fbd1006de932e0b0453c08c6549c1146ff0d616f594ea4f
MD5 8d3ebf52a6c20abb613320fd8c73e810
BLAKE2b-256 4a4426e8c9f633574b296d2a931e5bf2110bb52fcff004f17470ec299d2578c8

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e18b62825b45afaa7daaf316b0b743f5172fe52807ce602fd69f13cfb7520452
MD5 fb056ff3e9300cd2fe19b89ee7d824a4
BLAKE2b-256 36be6b60bc0917abaa0311c74c9c11af2cab000c48426f0aad36d7db0e7dc20c

See more details on using hashes here.

File details

Details for the file tribal_temp-0.0.1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tribal_temp-0.0.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 41e78d29070ad4b43d735ffbdca7cc5e016753ba7593fd6b74cba019e8e8d82e
MD5 cae48df48d386763eca1cf1b7fa27479
BLAKE2b-256 13997286a43dcc1610bb46c79b8b5c1ee0accb334ad8205c78238a0fe8e9cf09

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