{"id":21851551,"url":"https://github.com/antonio-leitao/udiph","last_synced_at":"2025-04-14T16:18:52.628Z","repository":{"id":62586113,"uuid":"446912239","full_name":"antonio-leitao/udiph","owner":"antonio-leitao","description":"UDiPH is a package that creates a new metric space where the points are uniformly sampled with respect to a global metric. It is oriented for creating Vietoris-Rips filtrations that are independent of the metric of the initial space.","archived":false,"fork":false,"pushed_at":"2022-01-12T17:34:45.000Z","size":394,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T16:18:38.716Z","etag":null,"topics":["filtration","homology","machine-learning","simplicial-complex","topological-data-analysis"],"latest_commit_sha":null,"homepage":"https://antonio-leitao.netlify.app/","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/antonio-leitao.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}},"created_at":"2022-01-11T17:10:08.000Z","updated_at":"2024-10-10T10:13:08.000Z","dependencies_parsed_at":"2022-11-03T22:07:39.512Z","dependency_job_id":null,"html_url":"https://github.com/antonio-leitao/udiph","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonio-leitao%2Fudiph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonio-leitao%2Fudiph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonio-leitao%2Fudiph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonio-leitao%2Fudiph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonio-leitao","download_url":"https://codeload.github.com/antonio-leitao/udiph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914118,"owners_count":21182359,"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":["filtration","homology","machine-learning","simplicial-complex","topological-data-analysis"],"created_at":"2024-11-28T01:08:42.826Z","updated_at":"2025-04-14T16:18:52.585Z","avatar_url":"https://github.com/antonio-leitao.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uniform Distributed Persistent Homology (UDiPH)\n\n\n[![Downloads](https://pepy.tech/badge/udiph)](https://pepy.tech/project/udiph) [![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://github.com/Antonio-Leitao/dbsampler/blob/main/LICENSE) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-03a80e.svg)](https://github.com/Antonio-Leitao) [![version ](https://img.shields.io/badge/release-0.0.2-blue.svg)](https://pypi.org/project/udiph/) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n\nUDiPH is a package that creates a new metric space where the points are uniformly sampled with respect to a global metric. It is oriented for creating Vietoris-Rips filtrations that are independent of the metric of the initial space. This work is very influced on [UMAP](https://github.com/lmcinnes/umap).\n\nUDiPH excells when comparing homology of spaces with different metrics, for example consider a continuous deformation acting on a set of points:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/udiph_readme.png\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nStandard Vietoris-Rips filtration:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/2filtrations_std.png\" width=\"600\"/\u003e\n\u003c/p\u003e\nVietoris-Rips filtration using metric space created by UDiPH is based on local density:\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/2filtrations_udiph.png\" width=\"600\"/\u003e\n\u003c/p\u003e\nSince we are in the presence of a continuous deformation it is expected that the homology remains invariant. However due to the difference in metric in the image space, the standard Vietoris-Rips filtration does not accuratly capture this invariance. Notice how a filtration using UDiPH manages to capture both homology generators.\n\n## Installation\nDependencies:\n  - Numpy\n  - Scipy\n  - Sklearn\n\nUDIPH is available on PyPI,\n\n```sh\npip install udiph\n```\n## Usage\n```python\nimport udiph\nM = udiph.UDIPH(X=X, n_neighbors=15, distance_matrix=False, return_complex=False)\n```\n**Parameters:**\n-  ``X``: numpy array of shape=(samples,features) or shape=(samples,samples) containing the data. If data is a pairwise distance matrix then ``distance_matrix`` must be set to True.\n -  ``n_neighbors``: number of nearest neighbors considered when creating the proximity graph. Too many and topological features are dissolved, too few are artifacts are created. Fairly robust.\n -  ``distance_matrix``: Boolean value indicating if input data is or not a distance_matrix \n -  ``return_complex``: Boolean value indicating whether to return the weighted 1-d simplicial complex instead of a pairwise distance matrix.\n \n**Returns:**\n -  ``M``: numpy array (samples, samples) pairwise distance matrix with respect to new Riemannian metric.\n -  ``A``: (optional) numpy array (samples, samples) adjacency matrix of the weighted 1-d simplicial complex.\n\n## How does it work?\nThe basic assumption on UDiPh relies on the idea that data comes uniformly sampled from an unknown Riemmannian manifold. As a consequence, \"bigger\" holes in the governing manifold are respresented by having a higher number of points sampled from their boundary, and \"small\" holes will have less points sampled.\n \n## Citation\nIf you use UDiPH in your work or parts of the algorithm please consider citing:\n\u003e Paper coming soon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonio-leitao%2Fudiph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonio-leitao%2Fudiph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonio-leitao%2Fudiph/lists"}