Representation of persistence diagrams using persistence codebooks
Project description
perscode
Vectorization methods for persistence diagrams based in the paper Persistence Codebooks for Topological Data Analysis.
Usage
import perscode
import numpy as np
# generate diagrams
diagrams = [np.random.rand(100,2) for _ in range(20)]
for diagram in diagrams:
diagram[:,1] += diagram[:,0]
# N is the size of the vectors
# normalize is a Bool to whether or not normalize the output vector
pbow = perscode.PBoW(N = 3, normalize = False)
wpbow = perscode.wPBoW(N = 3)
# n_subsample is an int or None. If none all points will be used when calculating GMMs.
spbow = perscode.sPBoW(N = 10, n_subsample = None)
# vectorize diagrams
pbow_diagrams = pbow.transform(diagrams)
wpbow_diagrams = wpbow.transform(diagrams)
spbow_diagrams = spbow.transform(diagrams)
# for PVLAD and stable PVLAD
pvlad = perscode.PVLAD(N = 3)
spvlad = perscode.sPVLAD(N = 3)
pvlad_diagrams = pvlad.transform(diagrams)
spvlad_diagrams = spvlad.transform(diagrams)
TODO
- Implement options to pass cluster centers as arguments in wPBoW and sPBoW.
- Implement PVLAD
- Implement sPVLAD
- Implement PFV
- Implement optional weighted subsampling to wPBoW, sPBoW, sPVLAD classes.
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
perscode-0.0.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
perscode-0.0.1-py3-none-any.whl
(13.0 kB
view hashes)