Hi,
I do not know if this is intentional behavior, but performing point sampling on more than one MASK_TIMELESS
seems to be impossible. In the example below, I sample an additional MASK_TIMELESS
called SPLIT
which is essentially a layer matching the extent of the LULC
training data but predefines which polygons are to be used for training and which for test (SPLIT == 1
for training and SPLIT == 2
for test). This is a less biased way of assigning polygons within an eopatch, especially if your training is sparse and only available in few eopatches. Moreover, for independent testing and validation, it’s more rigorous to make full polygon assignments and only sample training from certain ones, and test from completely different ones (what @matic.lubej is doing in SI_LULC_pipeline.ipynb guarantees an independent test set, but with a spatial bias towards certain eopatches because an entire eopatch is chosen for test, rather than randomly sampled polygons across the AOI).
spatial_sampling = PointSamplingTask(
n_samples=n_samples,
ref_mask_feature='LULC',
ref_labels=training_val,
sample_features=s # tag fields to sample
(FeatureType.DATA, 'FEATURES',),
(FeatureType.MASK, 'IS_VALID',),
(FeatureType.MASK_TIMELESS, 'LULC',),
(FeatureType.MASK_TIMELESS, 'SPLIT',)
],
even_sampling=True)
This does not work, but if assigning the new SPLIT
layer to DATA_TIMELESS
, it works:
spatial_sampling = PointSamplingTask(
n_samples=n_samples,
ref_mask_feature='LULC',
ref_labels=training_val,
sample_features=s # tag fields to sample
(FeatureType.DATA, 'FEATURES',),
(FeatureType.MASK, 'IS_VALID',),
(FeatureType.MASK_TIMELESS, 'LULC',),
(FeatureType.DATA_TIMELESS, 'SPLIT',)
],
even_sampling=True)
Therefore, it’s not a malfunction, but should be made explicit if this is intended behavior.
Thanks!
William