Skip to main content

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


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 details)

Uploaded Source

Built Distribution

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

perscode-0.0.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file perscode-0.0.1.tar.gz.

File metadata

  • Download URL: perscode-0.0.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2

File hashes

Hashes for perscode-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c03380257b2cb0d5af0954f9b94ca49cc18d417b4d73516fa0ba6ef60e8b8374
MD5 c22bf97f2532c31fb81025e5d30d9240
BLAKE2b-256 7260cd01dff7f7eaab84afd5fd17998bba609c2bd683639b54154b8f2bf78c8e

See more details on using hashes here.

File details

Details for the file perscode-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: perscode-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2

File hashes

Hashes for perscode-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 500bb429a6d858925726bd82ee1e5b75949e612f6ea501ecbef75a9db12705af
MD5 436d65a727c7fecab72a2b436e4b7213
BLAKE2b-256 e32068a49e23d77ce74b4f88272ef63db0247af7e4d7a9e30b5f74518a7287f8

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