Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinity_values having no effects #87

Closed
rocheze opened this issue Nov 15, 2019 · 1 comment
Closed

infinity_values having no effects #87

rocheze opened this issue Nov 15, 2019 · 1 comment

Comments

@rocheze
Copy link
Collaborator

rocheze commented Nov 15, 2019

Description

Steps/Code to Reproduce

homology_dimensions = [0,1]
point_cloud=np.array([[2994.15145385, 2994.6898423 ],
[2994.6898423 , 2995.25011228],
[2995.25011228, 2995.81086442],
[2995.81086442, 2996.34742252],
[2996.34742252, 2996.83255758],
[2996.83255758, 2997.23764226],
[2997.23764226, 2997.53431672],
[2997.53431672, 2997.69673226],
[2997.69673226, 2997.70440466],
[2997.70440466, 2997.545644 ],
[2997.545644 , 2997.22142019],
[2997.22142019, 2996.7493565 ],
[2996.7493565 , 2996.16730176],
[2996.16730176, 2995.53560389],
[2995.53560389, 2994.93679867],
[2994.93679867, 2994.4709825 ],
[2994.4709825 , 2994.2447852 ],
[2994.2447852 , 2994.35188093],
[2994.35188093, 2994.84392356],
[2994.84392356, 2995.69362524],
[2995.69362524, 2996.75785686],
[2996.75785686, 2997.75975786],
[2997.75975786, 2998.32505364],
[2998.32505364, 2998.12240867],
[2998.12240867, 2997.143359 ],
[2997.143359 , 2996.04017334],
[2996.04017334, 2996.09188423],
[2996.09188423, 2997.86034233],
[2997.86034233, 2998.66986234],
[2998.66986234, 2997.01000126],
[2997.01000126, 2998.64346342]])
VR = hl.VietorisRipsPersistence(homology_dimensions=[0,1],infinity_values=1000, n_jobs=-1)
diag_1=VR.fit_transform([point_cloud])
diag_1

Expected Results

array([[[0. , 0.15894595, 0. ],
[0. , 0.16259666, 0. ],
[0. , 0.25026929, 0. ],
[0. , 0.25280833, 0. ],
[0. , 0.33822262, 0. ],
[0. , 0.34334007, 0. ],
[0. , 0.35061181, 0. ],
[0. , 0.35918 , 0. ],
[0. , 0.36100698, 0. ],
[0. , 0.41400436, 0. ],
[0. , 0.42276978, 0. ],
[0. , 0.42685053, 0. ],
[0. , 0.46951547, 0. ],
[0. , 0.50210488, 0. ],
[0. , 0.51783192, 0. ],
[0. , 0.52743238, 0. ],
[0. , 0.5284006 , 0. ],
[0. , 0.56346232, 0. ],
[0. , 0.57062197, 0. ],
[0. , 0.57268244, 0. ],
[0. , 0.58013839, 0. ],
[0. , 0.60052001, 0. ],
[0. , 0.62384081, 0. ],
[0. , 0.63202029, 0. ],
[0. , 0.65805095, 0. ],
[0. , 0.67352563, 0. ],
[0. , 0.71318197, 0. ],
[0. , 0.75865167, 0. ],
[0. , 0.77610409, 0. ],
[0. , 0.81456721, 0. ],
------------------->[0. , 1000, 0. ],
[0.91897351, 1.08222294, 1. ],
[0.87040788, 0.95760375, 1. ],
[0.77724916, 0.80187225, 1. ],
[0.71346641, 0.87794894, 1. ],
[0.62420917, 0.7132709 , 1. ],
[0.43905503, 0.46689981, 1. ]]])

Actual Results

array([[[0. , 0.15894595, 0. ],
[0. , 0.16259666, 0. ],
[0. , 0.25026929, 0. ],
[0. , 0.25280833, 0. ],
[0. , 0.33822262, 0. ],
[0. , 0.34334007, 0. ],
[0. , 0.35061181, 0. ],
[0. , 0.35918 , 0. ],
[0. , 0.36100698, 0. ],
[0. , 0.41400436, 0. ],
[0. , 0.42276978, 0. ],
[0. , 0.42685053, 0. ],
[0. , 0.46951547, 0. ],
[0. , 0.50210488, 0. ],
[0. , 0.51783192, 0. ],
[0. , 0.52743238, 0. ],
[0. , 0.5284006 , 0. ],
[0. , 0.56346232, 0. ],
[0. , 0.57062197, 0. ],
[0. , 0.57268244, 0. ],
[0. , 0.58013839, 0. ],
[0. , 0.60052001, 0. ],
[0. , 0.62384081, 0. ],
[0. , 0.63202029, 0. ],
[0. , 0.65805095, 0. ],
[0. , 0.67352563, 0. ],
[0. , 0.71318197, 0. ],
[0. , 0.75865167, 0. ],
[0. , 0.77610409, 0. ],
[0. , 0.81456721, 0. ],
[0.91897351, 1.08222294, 1. ],
[0.87040788, 0.95760375, 1. ],
[0.77724916, 0.80187225, 1. ],
[0.71346641, 0.87794894, 1. ],
[0.62420917, 0.7132709 , 1. ],
[0.43905503, 0.46689981, 1. ]]])

Versions

Darwin-19.0.0-x86_64-i386-64bit
Python 3.6.7 | packaged by conda-forge | (default, Jul 2 2019, 02:07:37)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
NumPy 1.17.3
SciPy 1.3.1
joblib 0.14.0
Scikit-Learn 0.21.3
giotto-Learn 0.1.3

@ulupo
Copy link
Collaborator

ulupo commented Nov 19, 2019

This seems to be just due to VietorisRipsPersistence always removing one homology class in degree 0 which lives forever. Since there is always one such, it is not informative to keep it. I'll close the issue but it is true that this behaviour is not currently well documented.

@ulupo ulupo closed this as completed Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants