Skip to main content

Python implementation persistent images representation of persistence diagrams.

Project description

PyPI version Build Status codecov License: MIT

Persim

Persim is a Python implementation of Persistence Images as first introduced in https://arxiv.org/abs/1507.06217.

It is designed to interface with Ripser, though any persistence diagram should work fine.

Setup

Currently, the only option is to install the library from source:

pip install persim

Usage

First, construct a diagram. In this example, we will use Ripser.

import numpy as np
from ripser import Rips
from sklearn import datasets

data = np.concatenate([150 * np.random.random((300,2)), 
                       10 + 10 * datasets.make_circles(n_samples=100)[0],
                       100 + 20 * datasets.make_circles(n_samples=100)[0]])

rips = Rips()
dgm = rips.fit_transform(data)
diagram = dgm[1] # Just diagram for H1

data and diagram

Then from this diagram, we construct the persistence image

from persim import PersImage

pim = PersImage()
img = pim.transform(diagram)
pim.show(img)

pers image of H1 diagram

TODO

  • Implement a variety of weighting and kernel functions.

References:

Persistence Images were first introduced in Adams et al, 2017. Much of this work, an examples contained herein are inspired by the work of Obayashi and Hiraoka, 2017. Choices of weightings and general methods are often derived from Kusano, Fukumizu, and Yasuaki Hiraoka, 2016.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

persim-0.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persim-0.0.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file persim-0.0.5.tar.gz.

File metadata

  • Download URL: persim-0.0.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for persim-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c0691bfb350a7c296ec05b08fb665ca278fdf121da440ddf75b9af8be9354031
MD5 4c2eddca771c2387843bfdb49908fa76
BLAKE2b-256 9c09785206acb1209a1d64a8160c393bf583b1461c107b94c8f2a0d1f0dc3a8d

See more details on using hashes here.

File details

Details for the file persim-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for persim-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dae2f1a56095b90a2ce9df064c2a8cfcc2f31e259c316a1b7f1ad5c2b0a73b91
MD5 4f8fe0d515e40cc68a1c26cee4b77d78
BLAKE2b-256 8b417ce27a009d161b041d9eb3228b4a04e015dfed69024b006a9942555af50b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page