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

Bug in weights for ILP #6

Closed
the-mysh opened this issue May 27, 2024 · 8 comments · Fixed by #8
Closed

Bug in weights for ILP #6

the-mysh opened this issue May 27, 2024 · 8 comments · Fixed by #8

Comments

@the-mysh
Copy link
Contributor

Hey, I've noticed what seems to be a typo in line 104 in core.py.
The c which you use as argument to np.tile is not defined earlier.
I'd appreciate if you could let me know what the correct argument here is so that I can use weights in my computations.

@yoyololicon
Copy link
Owner

Oh thank you for catching the bug!
I'll push a fix real soon.

@yoyololicon
Copy link
Owner

fix in #7

@the-mysh
Copy link
Contributor Author

Perfect, thanks for addressing this so fast!

@the-mysh
Copy link
Contributor Author

the-mysh commented May 28, 2024

Actually, sorry, something is not quite right still. I'm now getting this ValueError:

ValueError: Invalid input for linprog: c must be a 1-D array and must not have more than one non-singleton dimension

coming from scipy\optimize\_linprog_util.py:302.

Maybe it's a question of the dimensionality of the weights I'm passing? My weights are 2D, the same shape as the input phase dataset, should I reshape them somehow?

I'm using scipy 1.11.1 on Python 3.11.7 if that helps.

@yoyololicon
Copy link
Owner

Maybe it's a question of the dimensionality of the weights I'm passing? My weights are 2D, the same shape as the input phase dataset, should I reshape them somehow?

Yes, both differences and weights should be flattened and have the same shape.
Are you using calculate_k directly or the wrapper unwrap_dimensional?
I should add a conversion function to pass the weights from the latter to the former.

@the-mysh
Copy link
Contributor Author

I'm using unwrap_dimensional, so yeah, I think I can see where the shape mismatch is coming from.
I might switch to the unwrap_arbitrary later though, because I often have NaNs in my data and it seems unwrap_dimensional is having some trouble with that (it tends to think for a long time and then crash my Jupyter Notebook kernel if there are NaNs)

@yoyololicon
Copy link
Owner

Hi @the-mysh,

Regarding data with NaN, you can check issue #3.

@the-mysh
Copy link
Contributor Author

Hi @yoyololicon, thanks for all the info. If you find some time to work on the weights shape conversion, I'll be excited to include it in my application!

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 a pull request may close this issue.

2 participants