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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 10.13+ x86-64

tribal-0.1.5-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.5-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 10.13+ x86-64

tribal-0.1.5-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.5-cp311-cp311-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

tribal-0.1.5-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.5-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

tribal-0.1.5-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.5.tar.gz.

File metadata

  • Download URL: tribal-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 899570a389e19c94822ae289cdac57071fbd13b950d4fef4a359fce1312d3bf2
MD5 ebe1740750376008cccc5e0898217347
BLAKE2b-256 201867ea34a8d40e28e56d4bae0f0429abf434f84f5a36ae876c5cfb59f821c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.1.5-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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c078412f8ec5f831de046d082f4ea9e1539670ca3fb6e686360500308629a50b
MD5 c53b7b7892c0b5c9dfeadd83bd8d3d49
BLAKE2b-256 62c5464dd84f412b979b858fc99f358870745292182c5d6380a8910e6bf35c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0339d61f626707a6c9c347b225a78645cfeca25310a8a4b074d079505ea73c46
MD5 0483d8df33295833899086764c21a495
BLAKE2b-256 68926ebda74d43d9a0cd1ba28f302dad26e56c43374e5075b214e54667219c2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b7a8fcdaaf6843dde8b9735e56e09e31d57dfece54e2eb9fa07b878752f886ab
MD5 3ff56ad988427c6e39bc54ed3acc788c
BLAKE2b-256 355d93e80e68bde308ff08857c7566d5dc85dcf2bd49baf47c9d7dd7b8a8d4b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 446a98ce7179e6e8070944cbf731909b1bf60f6b03384265db22eda80e8011ab
MD5 158fca3345e8ca7d6f15fc623c18ba20
BLAKE2b-256 fd4d177a579c599d67f642bf26e2f96420e06dc0b13065108b16f74b78570f89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.1.5-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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 568abab4f0ee1e11bd0629807bcc5b157e328f6cba5c9672c8d022e5f3bfa8d3
MD5 1213e6e415b700ae4879f03c5e2be0ee
BLAKE2b-256 e900c972d6d79efb88655334d26a82ccd5004e55a30a85d21137f07e2f8bf9aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e0914fc131b9b0d6bd90e74b6ce32bc40a932792dc6952ab062463cff9732fe5
MD5 6ff40871a5d49f530ffd2584ce379982
BLAKE2b-256 2749dd1f1822d6629df8f6f3e5dea068d0f1c69799a04cc1e485c7863ec32644

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 99150f131f53bb07038d53f2b72a83efa25748449acc8b74f6d8f22abe7bef7a
MD5 b334d433d643063d774067ca698c4842
BLAKE2b-256 a5f01236a18a5149eae62fbb272333328852f2c4ff97cfabb1ccbcdcd45d5f91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 d4ff145c79e7d4cf4135ab1facf2130432f646b9d716e5c04be20bb0faac92df
MD5 ab1000e990b26c0d9f966e7d707affa6
BLAKE2b-256 2e7774708024dfcb5f451e5baf31cf3cd203787668b96cac2681c9fd1b9a28db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.1.5-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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 df01581751e4242967ae5d8e3595786f9baef3dada7610e7fb6aea64f9ff545c
MD5 f1d1fcc75a67ea077fba5cef3e0f3408
BLAKE2b-256 80fe36de9be2d983b305b0da812886dfc74e56264d29adddad4d3bad3e147d31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5d305689b77540adc5baf2f8bc9056ff8ed291b6a915a581b1deaf1027d7c2eb
MD5 a136c007a0105cbe5758c8eda4235032
BLAKE2b-256 3d279de9bdc5aedfef0cbd52922ef2b81be881d9f4824c2dc60f1fe080504afd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a437d2d1e8e7b3a869e479b4fdf2f3d18613c5435f5fc9014ba8c5594021be8e
MD5 c79d9d105ba5b2b9c07be9c981966f3f
BLAKE2b-256 bc83c2c3f1fa90ab47ad66dec2270fae3be7359a556894db1e2d098873b43ed4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5c7fe6291cb10166176819d87cedf8d472d522c090edc1a6a0ac199498f36857
MD5 4be95a85ae46a72a12721b3864a53035
BLAKE2b-256 9c0cfa45fce7c0f7bb9555dcb51c536b0671694d0213af9fbb12f30824ebb9f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tribal-0.1.5-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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9abe11e1adfbbcfa32bd8f5cce893a557ef7e32e1472aed96fc6a91612ac5f7f
MD5 c12cbbbe68753afbd910e447091b22fb
BLAKE2b-256 ca427aacfc64b6abb59152109a6af1eeaa4688d22c9306833014571a6a6bf871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2a4442d57d04354b733194760a900fd63b9c2aea559213eb4226dde7a73215c
MD5 e62c9b58f178273c98a38ba1685e4801
BLAKE2b-256 100ec8763f14e11a34cde76954fbc53a74c66d22a1511a1523661891398fc002

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c5f70bc4a8ef4a397e0f7cc0af1fea289fcbca5fcba7e74d79e03e09af677967
MD5 c78a1c82b6c2348710f6b83a4c53f67e
BLAKE2b-256 f78ddfc046511ae7932c8f010dabbc4936da39d96699ec665f475b0a005d5a8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tribal-0.1.5-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a81f468790b6f6dc56c4acd4e7fcb306fb5544f452067567365db6d4e773d9b7
MD5 9c54bc7702be46f53c9c7bb794569c58
BLAKE2b-256 ca3f6c9a9fe04525fab9c6b5434466c21ba0b7fc1ed5fa761b8a40cc3bdb81a4

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