perrygeo/pyimpute

Bug in stratified_sample function

BuddyVolly opened this issue · 0 comments

Dear Perrygeo,

to me it seems there is a bug in line 267 in _main.py. You use the index over the index_array for the strata. Later, in the load_training_raster function, you apply directly the idx over your response data, so that it actually points to different data points that were selected by the stratification, and the actual sampling is not stratified as it should (you might even miss out some classes).

Therefore line 267 should be:

stratum = strata[idx]

Best,
BV