Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

declare knee if Tmx negative #15

Merged
merged 11 commits into from
Nov 22, 2018
Merged

declare knee if Tmx negative #15

merged 11 commits into from
Nov 22, 2018

Conversation

arvkevi
Copy link
Owner

@arvkevi arvkevi commented Oct 30, 2018

This change will declare a knee at the local maxima in the distance curve, if the threshold, self.Tmx is negative.

A negative threshold was pointed out in #13 -- With only 5 data points, the difference between the normalized x points, 0.20, was high relative to the maxima on the difference curve 0.18.

@arvkevi
Copy link
Owner Author

arvkevi commented Oct 30, 2018

It now finds the knee correctly here, but I don't know if this change will exhibit expected behavior in other, similar situations, so I'm going to wait to merge until further testing can be performed.

x = [3,4,5,6,7,8]
y = [1.4699,1.4149,1.3868,1.3594,1.3411,1.3265]

kneedle = KneeLocator(x, y, S=1.0, curve='convex', direction='decreasing')
kneedle.Tmx
array([-0.01645746])

kneedle.knee
4

@arvkevi arvkevi self-assigned this Nov 16, 2018
@arvkevi arvkevi mentioned this pull request Nov 16, 2018
@arvkevi arvkevi merged commit 111c188 into master Nov 22, 2018
@arvkevi arvkevi deleted the neg_threshold branch January 14, 2019 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant