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

Potentially wrong plot and/or knee identification #160

Open
jagandecapri opened this issue Apr 20, 2024 · 4 comments
Open

Potentially wrong plot and/or knee identification #160

jagandecapri opened this issue Apr 20, 2024 · 4 comments

Comments

@jagandecapri
Copy link

jagandecapri commented Apr 20, 2024

Hi @arvkevi,

Thank you for this cool library! 💯

I am experimenting with the following code:

from kneed import KneeLocator
import matplotlib.pyplot as plt

x = [0.90000, 0.99000, 0.99900, 0.99990, 0.99999]
y = [0.000019, 0.000046, 0.000050, 0.000050, 0.000050]

knee = KneeLocator(x, y, S=0.0, direction="increasing", curve="convex", online=True, interp_method="interp1d")
print(f"knee points: ({knee.knee}, {knee.knee_y})")
knee.plot_knee()
plt.show()
knee.plot_knee_normalized()
plt.show()

Output:

knee points: (0.99999, 5e-05)
knee_point
knee_normalized

I am not sure why the normalized knee plot is identifying the knee/elbow at 0 and I'm wondering why the knee point identified is at 0.99999? Shouldn't it be at 0.99?

Looking forward to your kind reply.

@arvkevi
Copy link
Owner

arvkevi commented Apr 21, 2024

Thanks for reporting this. It looks like making the changes discussed here addresses this issue.

@jagandecapri
Copy link
Author

jagandecapri commented Apr 21, 2024

Thank you for the prompt response. Is there any way I could help? I am using kneed for my research project and would love to get this issue fixed "soonish" as my data has such unevenly spaced points.

@arvkevi
Copy link
Owner

arvkevi commented Apr 21, 2024

Thanks for offering to help. Unfortunately, I won't be able to release a new version soon. I need to make sure any breaking changes are identified and handled, and that it's "correct." My recommendation for your research project is to clone the repo (or just copy KneeLocator class) and attempt to introduce the changes mentioned above locally.

@jagandecapri
Copy link
Author

Noted. I'll do as you have suggested. Have a pleasant week.

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

No branches or pull requests

2 participants