All Projects → arvkevi → Kneed

arvkevi / Kneed

Licence: bsd-3-clause
Knee point detection in Python 📈

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Kneed

Awesome Scientific Python
A curated list of awesome scientific Python resources
Stars: ✭ 127 (-61.28%)
Mutual labels:  data-science, data-analysis, scientific-computing
Gop
GoPlus - The Go+ language for engineering, STEM education, and data science
Stars: ✭ 7,829 (+2286.89%)
Mutual labels:  data-science, data-analysis, scientific-computing
Matplotplusplus
Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
Stars: ✭ 2,433 (+641.77%)
Mutual labels:  data-science, data-analysis, scientific-computing
Tiledb
The Universal Storage Engine
Stars: ✭ 1,072 (+226.83%)
Mutual labels:  data-science, data-analysis, scientific-computing
Collapse
Advanced and Fast Data Transformation in R
Stars: ✭ 184 (-43.9%)
Mutual labels:  data-science, data-analysis, scientific-computing
Datascience
Curated list of Python resources for data science.
Stars: ✭ 3,051 (+830.18%)
Mutual labels:  data-science, data-analysis
Igel
a delightful machine learning tool that allows you to train, test, and use models without writing code
Stars: ✭ 2,956 (+801.22%)
Mutual labels:  data-science, data-analysis
Ai Learn
人工智能学习路线图,整理近200个实战案例与项目,免费提供配套教材,零基础入门,就业实战!包括:Python,数学,机器学习,数据分析,深度学习,计算机视觉,自然语言处理,PyTorch tensorflow machine-learning,deep-learning data-analysis data-mining mathematics data-science artificial-intelligence python tensorflow tensorflow2 caffe keras pytorch algorithm numpy pandas matplotlib seaborn nlp cv等热门领域
Stars: ✭ 4,387 (+1237.5%)
Mutual labels:  data-science, data-analysis
Deep Learning Machine Learning Stock
Stock for Deep Learning and Machine Learning
Stars: ✭ 240 (-26.83%)
Mutual labels:  data-science, data-analysis
Machine Learning Resources
A curated list of awesome machine learning frameworks, libraries, courses, books and many more.
Stars: ✭ 226 (-31.1%)
Mutual labels:  data-science, data-analysis
Cjworkbench
The data journalism platform with built in training
Stars: ✭ 244 (-25.61%)
Mutual labels:  data-science, data-analysis
datajoint-python
Relational data pipelines for the science lab
Stars: ✭ 140 (-57.32%)
Mutual labels:  scientific-computing, data-analysis
Deepgraph
Analyze Data with Pandas-based Networks. Documentation:
Stars: ✭ 232 (-29.27%)
Mutual labels:  data-science, data-analysis
Tablesaw
Java dataframe and visualization library
Stars: ✭ 2,785 (+749.09%)
Mutual labels:  data-science, data-analysis
Akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 4,334 (+1221.34%)
Mutual labels:  data-science, data-analysis
Streamlit
Streamlit — The fastest way to build data apps in Python
Stars: ✭ 16,906 (+5054.27%)
Mutual labels:  data-science, data-analysis
Roger
Golang RServe client. Use R from Go
Stars: ✭ 248 (-24.39%)
Mutual labels:  data-science, scientific-computing
Urs
Universal Reddit Scraper - A comprehensive Reddit scraping command-line tool written in Python.
Stars: ✭ 275 (-16.16%)
Mutual labels:  data-science, data-analysis
Data Science Hacks
Data Science Hacks consists of tips, tricks to help you become a better data scientist. Data science hacks are for all - beginner to advanced. Data science hacks consist of python, jupyter notebook, pandas hacks and so on.
Stars: ✭ 273 (-16.77%)
Mutual labels:  data-science, data-analysis
Cryptocurrency Analysis Python
Open-Source Tutorial For Analyzing and Visualizing Cryptocurrency Data
Stars: ✭ 278 (-15.24%)
Mutual labels:  data-science, data-analysis

kneed

Knee-point detection in Python

Downloads Downloads Dependents Open in Streamlit Build Status codecov

This repository is an attempt to implement the kneedle algorithm, published here. Given a set of x and y values, kneed will return the knee point of the function. The knee point is the point of maximum curvature.

Table of contents

Installation

kneed has been tested with Python 3.5, 3.6, 3.7 and 3.8.

anaconda

$ conda install -c conda-forge kneed

pip

$ pip install kneed

Clone from GitHub

$ git clone https://github.com/arvkevi/kneed.git
$ python setup.py install

Usage

These steps introduce how to use kneed by reproducing Figure 2 from the manuscript.

Input Data

The DataGenerator class is only included as a utility to generate sample datasets.

Note: x and y must be equal length arrays.

from kneed import DataGenerator, KneeLocator

x, y = DataGenerator.figure2()

print([round(i, 3) for i in x])
print([round(i, 3) for i in y])

[0.0, 0.111, 0.222, 0.333, 0.444, 0.556, 0.667, 0.778, 0.889, 1.0]
[-5.0, 0.263, 1.897, 2.692, 3.163, 3.475, 3.696, 3.861, 3.989, 4.091]

Find Knee

The knee (or elbow) point is calculated simply by instantiating the KneeLocator class with x, y and the appropriate curve and direction.
Here, kneedle.knee and/or kneedle.elbow store the point of maximum curvature.

kneedle = KneeLocator(x, y, S=1.0, curve="concave", direction="increasing")

print(round(kneedle.knee, 3))
0.222

print(round(kneedle.elbow, 3))
0.222

The knee point returned is a value along the x axis. The y value at the knee can be identified:

print(round(kneedle.knee_y, 3))
1.897

Visualize

The KneeLocator class also has two plotting functions for quick visualizations. Note that all (x, y) are transformed for the normalized plots

# Normalized data, normalized knee, and normalized distance curve.
kneedle.plot_knee_normalized()

# Raw data and knee.
kneedle.plot_knee()

Documentation

Documentation of the parameters and a full API reference can be found here.

Interactive

An interactive streamlit app was developed to help users explore the effect of tuning the parameters. There are two sites where you can test out kneed by copy-pasting your own data:

  1. https://share.streamlit.io/arvkevi/ikneed/main/ikneed.py
  2. https://ikneed.herokuapp.com/

You can also run your own version -- head over to the source code for ikneed.

ikneed

Contributing

Contributions are welcome, please refer to CONTRIBUTING to learn more about how to contribute.

Citation

Finding a “Kneedle” in a Haystack: Detecting Knee Points in System Behavior Ville Satopa † , Jeannie Albrecht† , David Irwin‡ , and Barath Raghavan§ †Williams College, Williamstown, MA ‡University of Massachusetts Amherst, Amherst, MA § International Computer Science Institute, Berkeley, CA

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].