adaptive-curvefitting

Adaptive Curvefitting Tool

PyPI version PyPI - Downloads Downloads DOI

Adaptive curvefitting is a tool to find potentially optimal models for your research data. It’s based on scipy, numpy, and matplotlib.

Table of contents

Why is this tool

The very difference of adaptive-curvefitting with numpy.polyfit, scipy.optimize.curve_fit or scipy.optimize.least_squares is the hypothesis you don’t know which model to fit. If you already have the expected model, the methods in scipy and numpy are fantastic tools and better than this one. When you explore something unknown, this will be a maybe.

Installation, update and uninstallation

To install

Quick installation with pip:

pip install adaptive-curvefitting

Or from github:

pip install git+https://github.com/longavailable/adaptive-curvefitting

To update

pip install --upgrade adaptive-curvefitting

To uninstall

pip uninstall adaptive-curvefitting

Usage

Import the required module

In general,

import longscurvefitting

or import the specified function:

from longscurvefitting import oneClickCurveFitting
from longscurvefitting import generateFunction
from longscurvefitting import generateModels

Do the curvefitting

oneClickCurveFitting(xdata, ydata)

There are some optional arguments of oneClickCurveFitting.

See the complete example “/tests/curvefitting.py”.

Generate a expected model

Create a model composited by gaussian and erf function:

funcs = ['gaussian','erf']
myfunc = generateFunction(funcs, functionName='myfunc', operator='+')['model']

See the complete example “/tests/custom_a_model.py”.

Re-use the fitted curve

See the complete example “/tests/reuse_the_fitted_model.py”.

Shortages

How to cite

If this tool is useful to your research, star and cite it as below:

Xiaolong Liu, & Meixiu Yu. (2020, June 14). longavailable/adaptive-curvefitting. Zenodo. 
http://doi.org/10.5281/zenodo.3893596

Easily, you can import it to Mendeley.

Changelog

v0.1.3

v0.1.4