Skip to main content

Python implementation persistent images representation of persistence diagrams.

Project description

[![Build Status](https://travis-ci.org/sauln/persim.svg?branch=master)](https://travis-ci.org/sauln/persim)
[![codecov](https://codecov.io/gh/sauln/persim/branch/master/graph/badge.svg)](https://codecov.io/gh/sauln/persim)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# Persim <img align="right" width="40" height="40" src="https://imgur.com/8p6VwFm.jpg">

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

It is designed to interface with [Ripser](https://github.com/sauln/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](https://github.com/sauln/ripser).

``` Python
import numpy as np
from ripser import Rips

data = np.random.random((100,2))
rips = Rips()
dgm = rips.fit_transform(data)
diagram = dgm[1] # Just diagram for H1
```

Then from this diagram, we construct the persistence image

``` Python
from persim import PersImage

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


# TODO

- The API needs a little work, not quite sklearn compliant. Please do offer any suggestions.
- Implement more varieties of weighting and kernel functions.
- Build tests.



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.2.tar.gz (3.9 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.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for persim-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fea3520af0eb141040c6ef218980432ab7d24dd3b29e7afa6f505a4c6c362a83
MD5 cabcc70d456c7d29e8bc8fc08a2d1a24
BLAKE2b-256 ff88454c820065b7447d782c638986a87da7ed4a6e5fe4498b7d968274891a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for persim-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0ea5a7cf8f812057f8cb5a141b4c636de6a0944fe23f33c96556ea172fc1419
MD5 f0ffc2dde883a8d76d5a9ec204c0a194
BLAKE2b-256 16fa4b65a2f420e71c5364cb2cffe20289315f5a11e725a8efe3172997010db9

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