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

fix indices out-of-bounds from issues 10 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmitrimaxwellsymbolica
Copy link

I think dist variable should have length of d_num + d_nom because the heom distance function have loop of both d_num and d_nom, previously loop through d_num only will produce error when d_nom length is larger than d_num which resulted in index out of bound. My fix is not pretty, but it works on housing dataset from issues 10.

@nickkunz
Copy link
Owner

Is this tested on any other open data set that you could share? I'd like to address this problem and merge your PR after verifying the fix. Thanks!

@@ -46,7 +46,7 @@ def heom_dist(a_num, b_num, d_num, ranges_num, a_nom, b_nom, d_nom):
# import numpy as np

## create list to store distances
dist = [None] * d_num
dist = [None] * (d_num + d_nom)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged.

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

2 participants