Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants