Last active
January 23, 2020 14:33
-
-
Save lewtun/6cb6a44bcc7deea3815e9455f38ca71a to your computer and use it in GitHub Desktop.
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 matrix of pairwise distances | |
distance_matrix = ... | |
# define topological features to track | |
homology_dimensions = [0, 1, 2] | |
# define simplicial complex to construct | |
persistence = hl.VietorisRipsPersistence( | |
metric="precomputed", homology_dimensions=homology_dimensions | |
) | |
# calculate persistence diagram | |
persistence_diagram = persistence.fit_transform(distance_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment