gudhi-devel
gudhi-devel copied to clipboard
Speed of plot_persistence_density
plot_persistence_density
is rather slow, because the density estimation takes a lot of time. For a grid 300x300 and 10000 points, it already takes about 10s with scipy, and more if I try to use sklearn, even with a low precision. Since its main purpose is to help visualize diagrams with many points, that's an issue.
- The default bandwidth seems rather large, which both makes the output too blurry and probably slows down computations.
- Neither scipy not sklearn offer any option for parallelism :disappointed:
- When evaluating the KDE on a grid, much faster implementations exist (KDEpy, fastKDE). Similar to numpy.histogram2d + scipy.signal.convolve with a small mask?
- We are in no way restricted to Gaussian KDE, we could try other density estimators if they are faster.
See https://github.com/mglisse/TDA-tutorial/blob/density/Tuto-GUDHI-density-plot.ipynb (permalink) for an experiment trying to plot densities.
https://stackoverflow.com/q/20105364/1918193 contains some good ideas.