You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add minimal distance argument to local_maxima #3816
#3809 (comment) got me thinking that an argument specifying the minimal allowed euclidean distance between maxima could be very useful. I imagine it to work akin to this implementation in SciPy. The difficulty for the n-dimensional case is to only evaluate close neighbors as otherwise the complexity grows very unfavorably with the number of maxima. I wonder whether a KDTree could help optimizing that particular problem.
It's only an idea right now but before I investigate I'd like to know if there is an interest in adding this feature.
On Tue, 26 Mar 2019 05:43:20 -0700, Lars Grueter wrote:
It's only an idea right now but before I investigate I'd like to know
if there is an interest in adding this feature.
A big +1 from me. This is requested very often, and I've needed to same
in the past (fully expecting the current implementation to do that, but
learning otherwise each time).
Thinking about this there is another point that comes into play because local maxima are not restricted to a single sample. That means there are multiple approaches to how the distance between maxima is measured:
(A) Minimal distance is measured between the center of maxima. The center would be calculated as the arithmetic mean (central moment?) of all samples connected to a particular maximum. In this case the center could very well lie outside a maximum's contours.
(B) Minimal distance is the shortest distance between maximas' contours. Doing this in a smart and efficient way might be tricky.
Without taking algorithmic efficiency into consideration I find (B) more intuitive from a user perspective.
Activity
stefanv commentedon Mar 26, 2019
lagru commentedon Mar 27, 2019
That's good to know. :)
Thinking about this there is another point that comes into play because local maxima are not restricted to a single sample. That means there are multiple approaches to how the distance between maxima is measured:
Without taking algorithmic efficiency into consideration I find (B) more intuitive from a user perspective.