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

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

@CMFiltenborg

Description

@CMFiltenborg

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions