Code Monkey home page Code Monkey logo

ripserer.jl's Introduction

Ripserer.jl

Flexible and efficient persistent homology computation.

Coverage Status Build Status Documentation status

Introduction

Ripserer is a pure Julia implementation of the Ripser algorithm for computing persistent homology. Its aims are to be easy to use, generic, and fast.

See the documentation for more information and usage examples.

If you're looking for persistence diagram-related functionality such as Wasserstein or bottleneck distances, persistence images, or persistence curves, please see PersistenceDiagrams.jl.

Quick start

This package is registered. To install it, run the following.

julia> using Pkg
julia> Pkg.add("Ripserer")

Now, generate some data.

julia> data = [(rand(), rand(), rand()) for _ in 1:200]

The main exported function in this package is ripserer. By default, it computes Vietoris-Rips persistent homology on point cloud data and distance matrices.

julia> ripserer(data)
# 2-element Vector{PersistenceDiagramsBase.PersistenceDiagram}:
#  200-element 0-dimensional PersistenceDiagram
#  84-element 1-dimensional PersistenceDiagram

Several other filtration types are supported. We tell ripserer to use them by passing them as the first argument.

julia> ripserer(EdgeCollapsedRips, data)
# 2-element Vector{PersistenceDiagramsBase.PersistenceDiagram}:
#  200-element 0-dimensional PersistenceDiagram
#  84-element 1-dimensional PersistenceDiagram

Sometimes you may want to initialize a filtration in advance.

julia> rips = EdgeCollapsedRips(data, threshold=1)
# EdgeCollapsedRips{Int64, Float64}(nv=200)
julia> ripserer(rips, dim_max=2)
# 3-element Vector{PersistenceDiagramsBase.PersistenceDiagram}:
#  200-element 0-dimensional PersistenceDiagram
#  84-element 1-dimensional PersistenceDiagram
#  16-element 2-dimensional PersistenceDiagram

Ripserer supports plotting with Plots.jl. Experimental Makie.jl support is also available here.

Plotting persistence diagrams and barcodes is straightforward:

using Plots
result = ripserer(data, dim_max=2)
plot(plot(result), barcode(result)

barcode(result)

ripserer.jl's People

Contributors

github-actions[bot] avatar mtsch 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.