Skip to content

Add minimal distance argument to local_maxima #3816

Closed

Description

@lagru

#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.

Activity

  1. stefanv commented on Mar 26, 2019

    @stefanv
    Member
  2. lagru commented on Mar 27, 2019

    @lagru
    MemberAuthor

    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:

    • (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.

  3. locked and limited conversation to collaborators on Oct 18, 2021
  4. unlocked this conversation on Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions