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

Update sbm_estimators.py #1070

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

bokveizen
Copy link

@bokveizen bokveizen commented May 11, 2024

Reference Issues/PRs

See Issue #1055
See Pull Request #1056 (comment)

What does this implement/fix? Briefly explain your changes.

Expected Behavior

Any size-1 block should just have zero probability.

Actual Behavior

In sbm_estimators.py, _calculate_block_p calls _calculate_p, which divides zero when block.size = 0.
This can happen when some block has size one and loops=False is used.

Adding

if block.size == 0:
    continue

before Line 519 of graspologic/graspologic/models/sbm_estimators.py should do the trick.

bug fix for size-one blocks with loops=False
@bdpedigo
Copy link
Collaborator

hi @bokveizen, are you able to give edit access for maintainers on this PR?

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

Successfully merging this pull request may close these issues.

None yet

3 participants