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.2.tar.gz
(3.9 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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fea3520af0eb141040c6ef218980432ab7d24dd3b29e7afa6f505a4c6c362a83
|
|
| MD5 |
cabcc70d456c7d29e8bc8fc08a2d1a24
|
|
| BLAKE2b-256 |
ff88454c820065b7447d782c638986a87da7ed4a6e5fe4498b7d968274891a7b
|
File details
Details for the file persim-0.0.2-py3-none-any.whl.
File metadata
- Download URL: persim-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ea5a7cf8f812057f8cb5a141b4c636de6a0944fe23f33c96556ea172fc1419
|
|
| MD5 |
f0ffc2dde883a8d76d5a9ec204c0a194
|
|
| BLAKE2b-256 |
16fa4b65a2f420e71c5364cb2cffe20289315f5a11e725a8efe3172997010db9
|