{"id":23376022,"url":"https://github.com/danny-1k/torchclust","last_synced_at":"2025-06-13T07:35:32.123Z","repository":{"id":254244992,"uuid":"828954793","full_name":"danny-1k/torchclust","owner":"danny-1k","description":"Efficient and Scalable Implementations of Clustering Algorithms using Pytorch.","archived":false,"fork":false,"pushed_at":"2024-08-22T08:59:36.000Z","size":99,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T17:11:32.942Z","etag":null,"topics":["clustering-algorithm","dbscan","dbscan-clustering","kmeans-clustering","machine-learning","machine-learning-algorithms","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danny-1k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-15T13:11:02.000Z","updated_at":"2025-01-30T07:21:43.000Z","dependencies_parsed_at":"2024-08-22T09:13:41.137Z","dependency_job_id":"6acfa360-ae05-4446-9eed-64e3a5723d7a","html_url":"https://github.com/danny-1k/torchclust","commit_stats":null,"previous_names":["danny-1k/torchclust"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danny-1k%2Ftorchclust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danny-1k%2Ftorchclust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danny-1k%2Ftorchclust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danny-1k%2Ftorchclust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danny-1k","download_url":"https://codeload.github.com/danny-1k/torchclust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281416,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering-algorithm","dbscan","dbscan-clustering","kmeans-clustering","machine-learning","machine-learning-algorithms","pytorch"],"created_at":"2024-12-21T17:26:06.057Z","updated_at":"2025-04-10T19:33:10.653Z","avatar_url":"https://github.com/danny-1k.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](./assets/logo.png)\n\n# Torchclust: Clustering Algorithms written with Pytorch for running on GPU\n![License](https://img.shields.io/github/license/hmunachi/nanodl?style=flat-square) [![LinkedIn](https://img.shields.io/badge/-LinkedIn-blue?style=flat-square\u0026logo=linkedin\u0026logoColor=white)](https://linkedin.com/in/daniel-ik-human) [![Twitter](https://img.shields.io/twitter/follow/1sn00s?style=social)](https://twitter.com/1sn00s)\n\nTorchclust was developed to solve the issue of having to convert Pytorch Tensors to Numpy arrays and moving them to the CPU from the GPU in order to utilise frameworks such as scikit-learn.\n\nTorchclust features implementations of common clustering algorithms with a scikit-learn feel.\n\n## Implemented algorithms\n- Centroid-based Clustering\n    - KMeans\n    - MeanShift\n- Density-based Clustering\n    - DBSCAN\n    - Gaussian Mixture Model\n- Deep / Learning-based Clustering\n    - Self-Organising Maps\n- Metrics\n    - Internal\n        - Silhouette Score\n        - Interia\n        - Davies-Bouldin Index \n        - Calinski-Harabasz Score / Variance Ratio Criterion\n    - External\n        - Purity Score\n        - Rand Index\n        - Adjusted Rand Index\n        - Mutual Information\n        - Normalised Mutual Information\n\n## Contributing\nThis is still an ongoing project and contributions from the opensource community are warmly welcomed.\n\nContributions can be made in various forms:\n- Writing docs / Updating README\n- Fixings bugs\n- More efficient implementations of algorithnms\n- Or even implementing more algorithms\n\n## Installation\n\n*Be sure the GPU version of pytorch is installed if you intend to run the algorithms on GPU.*\n\n```bash\npip install torchclust\n```\n## Usage\n\n#### Kmeans on gaussian blobs\n```python\nimport torch\nimport matplotlib.pyplot as plt\n\nfrom torchclust.utils.datasets import make_blobs\nfrom torchclust.centroid import KMeans\n\nx, _ = make_blobs(1000, num_features=2, centers=3)\n\nkmeans = KMeans(num_clusters=3)\nlabels = kmeans.fit_predict(x)\n\nplt.scatter(x[:, 0], x[:, 1], c=labels)\nplt.show()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanny-1k%2Ftorchclust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanny-1k%2Ftorchclust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanny-1k%2Ftorchclust/lists"}