Closed CaioBertolini closed 2 years ago
The sample method required some TLC. I've updated the GitHub version and to be consistent with the other methods, the strata
argument now should have another Raster object passed to it. So the syntax would be:
import pyspatialml.datasets.nc as nc
from pyspatialml import Raster
predictors = [nc.band1, nc.band2, nc.band3, nc.band4, nc.band5, nc.band7]
stack = Raster(predictors)
strata = Raster(nc.strata)
# return arrays
X, xy = stack.sample(size=100, strata=strata, return_array=True)
# return dataframe
samples = stack.sample(size=100, strata=strata)
Please test and see if that helps.
Thank you for your help!! I tested the stratified random sampling after your update and it worked.
Hello @stevenpawley, thank you for this nice library!
I am having an issue with the stratified random sampling
Issue:
Code: