Giter Club home page Giter Club logo

antonio-leitao / udiph Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 394 KB

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.

Home Page: https://antonio-leitao.netlify.app/

License: MIT License

Python 100.00%
homology topological-data-analysis machine-learning simplicial-complex filtration

udiph's Introduction

Uniform Distributed Persistent Homology (UDiPH)

Downloads PyPI license Maintenance version made-with-python

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. This work is very influced on UMAP.

UDiPH excells when comparing homology of spaces with different metrics, for example consider a continuous deformation acting on a set of points:

Standard Vietoris-Rips filtration:

Vietoris-Rips filtration using metric space created by UDiPH is based on local density:

Since 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.

Installation

Dependencies:

  • Numpy
  • Scipy
  • Sklearn

UDIPH is available on PyPI,

pip install udiph

Usage

import udiph
M = udiph.UDIPH(X=X, n_neighbors=15, distance_matrix=False, return_complex=False)

Parameters:

  • 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_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.
  • distance_matrix: Boolean value indicating if input data is or not a distance_matrix
  • return_complex: Boolean value indicating whether to return the weighted 1-d simplicial complex instead of a pairwise distance matrix.

Returns:

  • M: numpy array (samples, samples) pairwise distance matrix with respect to new Riemannian metric.
  • A: (optional) numpy array (samples, samples) adjacency matrix of the weighted 1-d simplicial complex.

How does it work?

The 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.

Citation

If you use UDiPH in your work or parts of the algorithm please consider citing:

Paper coming soon

udiph's People

Contributors

antonio-leitao avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.