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

Loading extracted features with masks, mask is not loaded #69

Open
CMFiltenborg opened this issue Jun 26, 2019 · 0 comments
Open

Loading extracted features with masks, mask is not loaded #69

CMFiltenborg opened this issue Jun 26, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@CMFiltenborg
Copy link

CMFiltenborg commented Jun 26, 2019

When loading computed features at a later time, the mask is not properly loaded...
This cost me quite some time to figure out what was going on with my features (all my statistics were messed up, +infinity for the means, etc)

I was loading features from .tif files.
I did look at the feature loading/saving code but it seemed like there is code for handling the mask...

This is the temporary fix I used (which assumes the mask fill_value = 1e+20):

x_test_mask = np.ma.masked_values(x_test, 1e+20)
mask = x_test_mask.mask

vector_mask = np.any(mask, axis=1)

index_vector = ~vector_mask
x_test = x_test[index_vector]
y_test = y_test[index_vector]
@bouweandela bouweandela added the bug Something isn't working label Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants