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

Why is participation ratio rounded to an integer? #12

Closed
RylanSchaeffer opened this issue Mar 31, 2022 · 8 comments
Closed

Why is participation ratio rounded to an integer? #12

RylanSchaeffer opened this issue Mar 31, 2022 · 8 comments

Comments

@RylanSchaeffer
Copy link

I just noticed that participation ratio is always an integer. Why is that?

de = int(PR)

@j-bac
Copy link
Collaborator

j-bac commented Apr 1, 2022

Yes it is rounded. If you think it is more useful or standard not to round I can make the change

@RylanSchaeffer
Copy link
Author

RylanSchaeffer commented Apr 1, 2022

I've never heard of it being rounded, nor had two of my labmates. We also tried to find whether anyone recommends rounding it in a paper, but weren't successful.

Overall, it's not a big deal. We were just perplexed why we were getting integer values and thought we were misusing the library. Maybe change it?

@j-bac
Copy link
Collaborator

j-bac commented Apr 2, 2022

Just updated, thanks for the suggestion. Will release on pypi after some other updates

@j-bac j-bac closed this as completed Apr 2, 2022
@RylanSchaeffer
Copy link
Author

@j-bac any updates on the new release?

@j-bac
Copy link
Collaborator

j-bac commented Jul 30, 2022

my bad, I did make a new release but seems it didn't include the change. Just added v0.3.1 on pypi

@RylanSchaeffer
Copy link
Author

RylanSchaeffer commented Jul 31, 2022

I'm afraid that change introduced an error. Because de is now now longer an integer, this indexing breaks:

return de, gaps[de - 1]

@RylanSchaeffer
Copy link
Author

The error:

python3.7/site-packages/skdim/id/_PCA.py", line 192, in _participation_ratio
    return de, gaps[de - 1]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

@j-bac
Copy link
Collaborator

j-bac commented Jul 31, 2022

Thanks, just fixed this (0.3.2). I'm returning all gaps now under self.gap_

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