Last active
January 23, 2020 14:34
-
-
Save lewtun/224057083a600b10a7f3985d89a07b6d to your computer and use it in GitHub Desktop.
Snippet to calculate persistence diagram from point cloud data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gtda.homology as hl | |
# represent data as a point cloud | |
point_cloud = ... | |
# define topological features to track | |
homology_dimensions = [0, 1, 2] | |
# define simplicial complex to construct | |
persistence = hl.VietorisRipsPersistence( | |
metric="euclidean", homology_dimensions=homology_dimensions | |
) | |
# calculate persistence diagram | |
persistence_diagram = persistence.fit_transform(point_cloud) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment