[Subsampling module] Get indices that produce the subsample #1284
jlazovskis
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
Having the index instead of the point sounds like a good idea, and if we were to start from scratch, I would probably make those functions return the indices. Since we have to deal with backwards compatibility, things are a bit more complicated.
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In the theme of
argsortbeing related tosortin Python, I would like to get the indices that produce subsamples constructed by the functions in the subsampling module ( link ).Use case: I have a point cloud of (x,y)-values (observations in latitude and longitude), and each (x,y)-value has two other variables associated to it (climatic variables). I sparsify the (x,y)-values using
sparsify_point_set1, but to get back the associated variables, I have to find which original point matches every sparsified point, which feels very circuitous (given that I already have done the sparsification) and potentially imprecise (if I have (almost exactly) the same (x,y)-value twice, each with different associated variables).Suggested solution: Include a new argument in each of the functions of the subsampling module (there are four there currently), something like
bool argsampleorbool get_indices, with a default valuefalse, to ensure backwards compatibility.false, the functions do the same thing they do now.true, the values placed in the output iteratoroutput_itare the indices of the elements selected from the inputinput_pts, instead of the elements themselvesAs my suggestion is to modify existing functions, I am interested to hear if there are unforseen issues my solution would introduce, or if there is a more appropriate way to do this, or something else. Once (if) a solution is accepted, I am happy to implement it in a pull request.
Footnotes
I am aware this function uses Euclidean distance on the inputs, which is not the same as spherical distance for latitude and longitude inputs. I would like to have a distance option for these subsampling functions as well, but that is another discussion. ↩
All reactions