Light Weight Homology Framework
Project description
LHF: Lightweight Homology Framework
LHF is a homology framework designed for enabling modular pipelines for preprocessing and experiments around computing persistent homology. The base pipelines enable LHF to compute persistence intervals of an input point cloud by evaluating the distance matrix, building the simplicial complex, and reducing the complex to identify the persistence intervals at different dimensions.
Additional pipelines have been created for preprocessing, approximations of the boundary matrix, approximate simplicial complexes representing the input point cloud, boundary extraction, and upscaling based on previous studies detailed in several of the references below. The intent for LHF is to provide a modular framework to continue exploring, developing, and evaluating mechanisms for approximating or optimizing the computation of persistent homology over an input point cloud.
The python interface to LHF, available from pypi, uses ctypes to expose the LHF shared object library. This enables python users to call the LHF library on data and retrieve the entire pipepacket object used by LHF.
Installing:
pip install lhf
Documentation:
LHF docs are included with the source repository and built with doxygen. To build and view the docs, clone the LHF github repository. Build the documentation from the root folder using:
doxygen
Doxygen creates both HTML and Latex documentation in the lhf/docs folder. For HTML, navigate to index.html and open in a web browser to view the class documentation of both the python interface and the LHF cpp library.
Examples:
Run PH on input data
import lhf
import tadasets
data = tadasets.dsphere(n=50, d=5, r=1, noise=0.1)
pyLHF = lhf.createPipeline()
#Set LHF args
pyLHF.config["epsilon"] = 1.0
pyLHF.config["dimensions"] = 3
boundaryPis, pipePacket, elapsed = pyLHF.runPH(data)
Plot the output in several ways
import lhf
import tadasets
import numpy as np
data = tadasets.dsphere(n=50, d=5, r=1, noise=0.1)
pyLHF = lhf.createPipeline()
boundaryPis, pipePacket, elapsed = pyLHF.runPH(data)
#Remove boundary labels from the PIs
pis = np.array([[z[0], z[1], z[2]] for z in boundaryPis])
LHF.OutputAnalysis.persistenceDiagram(pis)
LHF.OutputAnalysis.barcodeDiagrams(pis)
LHF.OutputAnalysis.bettiCurve(pis)
Run Partitioned Persistent Homology
import lhf
import tadasets
data = tadasets.dsphere(n=50, d=5, r=1, noise=0.1)
pyLHF = lhf.createPipeline()
#Set LHF args
pyLHF.config["epsilon"] = 1.0
pyLHF.config["dimensions"] = 3
pyLHF.config["mode"] = "iterUpscale"
pyLHF.config["preprocessor"] = "kmeans++"
pyLHF.config["clusters"] = 20
boundaryPis, pipePacket, elapsed = pyLHF.runPH(data)
Run PH on Weighted Alpha Complex
import lhf
import tadasets
data = tadasets.dsphere(n=50, d=5, r=1, noise=0.1)
pyLHF = lhf.createPipeline()
#Set LHF args
pyLHF.config["epsilon"] = 1.0
pyLHF.config["dimensions"] = 3
pyLHF.config["mode"] = "weightedAlpha"
boundaryPis, pipePacket, elapsed = pyLHF.runPH(data)
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 Distributions
Built Distribution
File details
Details for the file lhf-2.0.1-py3-none-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: lhf-2.0.1-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d9602279ff32d112993b5542797dad3cba5facfd8ebc485e26e779bc8b60e70 |
|
MD5 | 7bcef56a9fb28e2c5d3e0a64372a38fb |
|
BLAKE2b-256 | 127e0df56306a500c082c13342eba72b26b6f52e1182e08cefdddf5842afe81f |