{"id":40107847,"url":"https://github.com/alexpof/poincarekmeans","last_synced_at":"2026-01-19T11:35:10.988Z","repository":{"id":190945303,"uuid":"157263145","full_name":"AlexPof/PoincareKMeans","owner":"AlexPof","description":"K-Means algorithm in the Poincare Disk Model","archived":false,"fork":false,"pushed_at":"2018-11-12T19:36:27.000Z","size":132,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T03:51:23.575Z","etag":null,"topics":["clustering","hyperbolic-geometry","k-means","kmeans","poincare-embeddings"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexPof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-11-12T19:12:52.000Z","updated_at":"2025-07-05T16:22:51.000Z","dependencies_parsed_at":"2023-08-27T09:40:02.997Z","dependency_job_id":null,"html_url":"https://github.com/AlexPof/PoincareKMeans","commit_stats":null,"previous_names":["alexpof/poincarekmeans"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexPof/PoincareKMeans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPof%2FPoincareKMeans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPof%2FPoincareKMeans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPof%2FPoincareKMeans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPof%2FPoincareKMeans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexPof","download_url":"https://codeload.github.com/AlexPof/PoincareKMeans/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPof%2FPoincareKMeans/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28566593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","hyperbolic-geometry","k-means","kmeans","poincare-embeddings"],"created_at":"2026-01-19T11:35:10.918Z","updated_at":"2026-01-19T11:35:10.980Z","avatar_url":"https://github.com/AlexPof.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoincareKMeans: K-Means algorithm in the Poincare Disk Model\n\nThis a simple K-Means algorithm for clustering points in the Poincare Disk Model, a model for hyperbolic space.\nThis package was develop to exploit the results of Nickel \u0026 Kiela's *Poincare Embeddings* (as described in the paper\n[Poincaré Embeddings for Learning Hierarchical Representations](https://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations)).\n\nThis code has not been optimized. All contributions (for example for optimizing it for large sample sizes) are welcome.\n\n## Usage\n\nThe API follows closely that of [scikit-learn K-Means](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html).\nA model is obtained by importing and instantiating PoincareKMeans\n\n    \u003e\u003e\u003e model = PoincareKMeans()\n\nThe options are as follows.\n\n  * *n_clusters (default 8)*: number of clusters to be determined\n  * *n_init (default 20)*: number of time the k-means algorithm will be run with different centroid seeds.\n  * *max_iter (default 300)*: maximum number of iterations of the k-means algorithm for a single run.\n  * *tol (default 1e-8)*: tolerance criteria to declare convergence for each run.\n  * *verbose (default True)*: verbosity mode. If True, will display the best inertia obtained for each run.\n\nThe model is trained on the dataset using *fit*\n\n    \u003e\u003e\u003e model.fit(X)\n\nAdditional methods are provided:\n  * *fit_predict*: compute centroids and predict cluster index for each sample.\n  * *fit_transform*: compute clustering and transform X to cluster-distance space.\n  * *predict*: predict cluster index for the given sample.\n  * *transform*: computer cluster-distance for the given sample.\n\n## Example\n\nAn example, using some coordinates obtained by Nickel \u0026 Kiela's embedding algorithm, is provided.\nThe output should be analog to the following Figure.\n\n![poincare_clustering](poincare_clustering.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpof%2Fpoincarekmeans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpof%2Fpoincarekmeans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpof%2Fpoincarekmeans/lists"}