Python implementation persistent images representation of persistence diagrams.
Project description
[](https://travis-ci.org/sauln/persim)
[](https://codecov.io/gh/sauln/persim)
[](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.
[](https://codecov.io/gh/sauln/persim)
[](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
Release history Release notifications | RSS feed
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.3.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file persim-0.0.3.tar.gz.
File metadata
- Download URL: persim-0.0.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13d50605975e2a1fd7671e1302e498e9148c417271c07e51e2cab6860234083c
|
|
| MD5 |
be29d9ce5a140a196e2ba73d165a3418
|
|
| BLAKE2b-256 |
633d35723c8965287a1723b3b8ed2fcac2e00853547b1efb4502933f4834cb75
|
File details
Details for the file persim-0.0.3-py3-none-any.whl.
File metadata
- Download URL: persim-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1cd1fde26a32533db8af812d4940ad67a11fd83347bcdf6e0cb3b5542ed8a55
|
|
| MD5 |
072e09e5c84bc7b9d79126cf6ab369c8
|
|
| BLAKE2b-256 |
28049452c0d9c78a4182ab5eca4395c22de6e6fef206bc4c277486ed3634bff5
|