Package: knee
(Multi)Knee/Elbow point detection libraryEstimating the knee/elbow point in performance curves is a challenging task.
However, most of the time these points represent ideal compromises between cost and performance.This library implements several well-known knee detection algorithms:Discrete CurvatureDFDTKneedleL-methodMenger curvatureFurthermore, the code in this library expands the ideas on these algorithms to
detect multi-knee/elbow points in complex curves.
We implemented a recursive method that allows each of the previously mentioned methods
to detect multi-knee and elbow points.
Some methods natively support multi-knee detection, such as:KneedleFusionZ-methodFinally, we also implemented additional methods that help with knee detection tasks.
As a preprocessing step, we develop a custom RDP algorithm that reduced a discrete
set of points while keeping the reconstruction error to a minimum.
As a post-processing step we implemented several algorithms:1D dimensional clustering, is used to merge close knee pointsSeveral filters out non-relevant kneesKnee ranking algorithms that used several criteria to assess the quality of a knee pointRunning unit testsSeveral unit tests were written to validate some corner cases.
The unit tests were written inunittest.
Run the following commands to execute the unit tests.python3-mvenvvenvsourcevenv/bin/activate
python-mpipinstall--upgradepip
pipinstall.
python-munittestDocumentationThis library was documented using the google style docstring, it can be accessedhere.
Run the following commands to produce the documentation for this library.python3-mvenvvenvsourcevenv/bin/activate
pipinstallpdoc
pdoc--math-dgoogle-odocssrc/knee\--logohttps://raw.githubusercontent.com/mariolpantunes/knee/main/media/knee.png\--faviconhttps://raw.githubusercontent.com/mariolpantunes/knee/main/media/knee.pngInstalationTo install the library locally, simple execute the following commands:python3-mvenvvenvsourcevenv/bin/activate
python-mpipinstall--upgradepip
pipinstall.You can also use the PyPI repository for easy access to the library:knee>=0.1Runing the demosThe demos can be execute as python modules using the following code:python-mdemos.curvature-i[trace]python-mdemos.dfdt-i[trace]python-mdemos.fusion-i[trace]python-mdemos.kneedle_classic-i[trace]python-mdemos.kneedle_rec-i[trace]python-mdemos.kneedle-i[trace]python-mdemos.lmethod-i[trace]python-mdemos.menger-i[trace]python-mdemos.zmethod-i[trace]Most demos have the same parameters (with the exception of zmethod and kneedle_classic):python-mdemos.curvature-husage:curvature.py[-h]-iI[-a][-rR][-tT][-cC][-o][-g][-k{left,linear,right,hull}]MultiKneeevaluationapp

optionalarguments:-h,--helpshowthishelpmessageandexit-iIinputfile-aaddevenspacedpoints-rRRDPreconstructionthreshold-tTclusteringthreshold-cCcornerthreshold-ostoreoutput(debug)-gdisplayoutput(debug)-k{left,linear,right,hull}KneerankingmethodAuthorsMário AntunesTyler EstroLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.CopyrightThis project is under the followingCOPYRIGHT.MIT LicenseCopyright (c) 2020 Mário AntunesPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Copyright (c) 2021-2023 Stony Brook University
Copyright (c) 2021-2023 The Research Foundation of SUNY