scikit-tda / tadasets

Synthetic data sets apt for Topological Data Analysis
http://tadasets.scikit-tda.org
MIT License
34 stars 7 forks source link

Swiss cheese #11

Closed Filco306 closed 3 years ago

Filco306 commented 3 years ago

Added a d-dimensional swiss cheese with tests. I think we need to investigate its qualitites further, but it does its job.

The cheese is a hypercube between -1 and 1 with small, randomized spheres in which points are not permitted. I think these can serve as interesting examples to clearly demonstrate Persistent Homology.

Filco306 commented 3 years ago

We should probably wait with this one until #8 is merged.

Filco306 commented 3 years ago

I think this is a pretty cool 2d swiss cheese :D

Skärmavbild 2020-11-16 kl  16 23 56
ctralie commented 3 years ago

Looks great!!

On Mon, Nov 16, 2020 at 10:25 AM Filip Cornell notifications@github.com wrote:

I think this is pretty cool 2d swiss cheese :D

[image: Skärmavbild 2020-11-16 kl 16 23 56] https://user-images.githubusercontent.com/12938910/99272630-4b2d6080-2828-11eb-99c1-4530dfacded4.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scikit-tda/tadasets/pull/11#issuecomment-728132195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJWDZQZMURZVEWBW3BEYJLSQE77VANCNFSM4TTXV6DA .

Filco306 commented 3 years ago

Awesome! And by the way, I will do another modification here before merging this in.

The radii of spheres in d dimensions increase by the number of dimensions. I did some amateur math the other day, and concluded some small stuff.

  1. Assume a hypersphere in d dimensions, such that , then we have that .
  2. If we assume the case where for a hypersphere with dimension d, the radius has to increase at the speed of . If we consider d = 2 as our basecase, it is suitable to multiply the sampling of the radii by , don't you think?

Let me know your opinion on this; either way, I think I will add that quick modification here.

Cheers!

Filco306 commented 3 years ago

Actually, let me take all of that back, haha. This is harder than I thought; maintaining the ratio between a hypersphere and a hypercube is not that easy. Brb with some further analysis

Filco306 commented 3 years ago

Hello! I have to work on this a little bit more I believe. I think a start is just to produce swiss cheeses for 2 and 3 dimensions. Let's leave it for higher dimensions for now; those are much more complicated I believe.

Thank you!

sauln commented 3 years ago

@Filco306 sorry for disappearing on this PR.. What do you think, is it ready to go? I've updated the deploy process, so it should be easy for us to get it out there when it's ready. You'll have to merge master, fix the merge conflicts, and bump a new version (I think 0.3).

Let me know if you want to keep working on this, or get it out and then create a new PR for more upgrades?

Filco306 commented 3 years ago

Hello again @sauln ,

I think I want to redo this one and wait for another. I will close this PR and get back to you with a new one.

In short, the problem is the combination of hypersquares and hyperspheres. Combining these make the relation between the volume of the holes and the entire surface tend to infinity, which more or less removes the holes. I will either do a swiss cheese with hypercube holes or hyperspheres with hyperspheres holes, not the two combined :)

Again, sorry for my late reply here!

Filco306 commented 3 years ago

One thing I can do however is to generate 2d- and 3d-swiss cheeses. In just 2 or 3 dimensions, the combination does work :)