findlinear-0.4.2
توضیحات
To find the linear segment of a curve or dataset.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | findlinear-0.4.2 |
| نام | findlinear |
| نسخه کتابخانه | 0.4.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Yu Huo |
| ایمیل نویسنده | yu.huo@ed.ac.uk |
| آدرس صفحه اصلی | https://findlinear.readthedocs.io |
| آدرس اینترنتی | https://pypi.org/project/findlinear/ |
| مجوز | MIT |
# findlinear: Determining the linear segments of data with Bayesian model comparison
`findlinear` is a Python module for finding the linear segment given a curve or dataset with `x` and `y`.
## How does it work?
It uses the idea of Bayesian model comparison and calculate the evidence of each possible segment of curve being linear.
After calculating the evidence of each segment, it detects the global maximum, or uses the `findpeaks` library to find the local maxima of evidence, from which the user can choose the relevant linear segment (e.g. that with the largest evidence, or that with the largest slope when the data consists of multiple linear segments).
## Installation
For users, type in terminal
```
> pip install findlinear
```
For developers, create a virtual environment and then type
```
> git clone https://git.ecdf.ed.ac.uk/s1856140/findlinear.git
> cd findlinear
> poetry install --with dev
```
## Quickstart
Data `x` is a list or a 1D Numpy array, sorted ascendingly; the data `y` is a list or a Numpy array, with each row being one replicate of measurement.
```
>>> from findlinear.findlinear import findlinear, get_example_data
>>> x, y = get_example_data()
>>> fl = findlinear(x, y)
>>> fl.find_all()
>>> fl.plot()
>>> fl.get_argmax()
>>> fl.get_peaks()
```
## Documentation
Detailed documentation is available on [Readthedocs](https://findlinear.readthedocs.io/en/latest/).
## Citation
A preprint is coming soon.
نیازمندی
| مقدار | نام |
|---|---|
| >=1.9,<2.0 | sympy |
| >=1.20.3,<2.0.0 | numpy |
| >=1.7.3,<2.0.0 | scipy |
| >=3.5.0,<4.0.0 | matplotlib |
| >=2.4,<3.0 | findpeaks |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8,<3.11 | Python |
نحوه نصب
نصب پکیج whl findlinear-0.4.2:
pip install findlinear-0.4.2.whl
نصب پکیج tar.gz findlinear-0.4.2:
pip install findlinear-0.4.2.tar.gz