I use RIPSER
library in python to analyze my data(TDA)
. The plot(data)
i have used is 2-d
, but when i use ripser
to analyze, it gives me output with three homology groups(H0, H1, H2)
. But this is not possible, since H0
represents the connected components and H1
represents the HOLES
in 2-d
plot, whereas H2
represents the VOID
in the plot which is not possible in a 2-d plot
.
The code that i have used:
import matplotlib
import numpy as np
from ripser import ripser
from persim import plot_diagrams
from matplotlib import pyplot as plt
data = np.loadtxt('t=25_data(0.38).dat')
fig = plt.figure()
plt.title("PERSISTENCE DIAGRAM")
diagrams = ripser(data, maxdim=2)['dgms'] #### persistence diagram
### LIFETIME plot
plot_diagrams(diagrams, show=True)
plot_diagrams(diagrams, lifetime=True)