Skip to content

Commit

Permalink
Adding documentation for crocker and betti
Browse files Browse the repository at this point in the history
  • Loading branch information
stanweer1 authored May 12, 2023
1 parent cf0e696 commit 2c43fe8
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion docs/_sources/persistence.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Persistence
============

.. automodule:: teaspoon.TDA.Persistence
:members: minPers, maxPers, maxBirth, minBirth, minPersistenceSeries, maxPersistenceSeries, minBirthSeries, maxBirthSeries, removeInfiniteClasses
:members: minPers, maxPers, maxBirth, minBirth, minPersistenceSeries, maxPersistenceSeries, minBirthSeries, maxBirthSeries, removeInfiniteClasses, BettiCurve, CROCKER

The following example computes the minimum and maximum birth times, as well as the maximum persistence::

Expand Down Expand Up @@ -49,3 +49,37 @@ The output of this code is::
Maximum Birth of all diagrams: 1.2070081233978271
Minimum Birth of all diagrams: 0.028233738616108894
Max Persistence of all diagrams: 1.6290252953767776

The following example computes the Betti Curve for a persistence diagram::

from teaspoon.MakeData.PointCloud import Torus
from teaspoon.TDA.Persistence import BettiCurve
from ripser import ripser

T = Torus(N=300, r=1, R=2, seed=48823)
Dgm = ripser(T,2)['dgms'][1]
t, x = BettiCurve(Dgm,3,5)
print('Betti Curve:', x)

The output of this code is::

Betti Curve: [ 0. 36. 2. 0. 0.]


The following example computes the CROCKER plot for a set of persistence diagrams::

from teaspoon.MakeData.PointCloud import Torus
from teaspoon.TDA.Persistence import CROCKER
from ripser import ripser

DGMS = []
for i in range(0, 5):

T = Torus(N=300, r=i+1, R=i+2, seed=48823)
Dgm = ripser(T,2)['dgms'][0]
DGMS.append(Dgm)

Crocker = CROCKER(DGMS, 3, 5, plotting=False)

0 comments on commit 2c43fe8

Please sign in to comment.