Package: adaptive-curvefitting
Adaptive Curvefitting ToolAdaptive curvefitting is a tool to find potentially optimal models for your research data. It's based onscipy,numpy, andmatplotlib.Table of contentsWhy is this tool?Installation, update and uninstallationTo installTo updateTo uninstallUsageImport the required moduleDo the curvefittingGenerate a expected modelRe-use the fitted curveShortagesHow to cite?ChangelogWhy is this toolThe very difference of adaptive-curvefitting withnumpy.polyfit,scipy.optimize.curve_fitorscipy.optimize.least_squaresisthe hypothesis you don’t know which model to fit. If you already have the expected model, the methods inscipyandnumpyare fantastic tools and better than this one.When you explore something unknown, this will be a maybe.Installation, update and uninstallationTo installQuick installation withpip:pipinstalladaptive-curvefittingOr from github:pipinstallgit+https://github.com/longavailable/adaptive-curvefittingTo updatepipinstall--upgradeadaptive-curvefittingTo uninstallpipuninstalladaptive-curvefittingUsageImport the required moduleIn general,importlongscurvefittingor import the specified function:fromlongscurvefittingimportoneClickCurveFittingfromlongscurvefittingimportgenerateFunctionfromlongscurvefittingimportgenerateModelsDo the curvefittingoneClickCurveFitting(xdata,ydata)There are some optional arguments ofoneClickCurveFitting.functions: specified or all (default) basic models(name of models) to fit.Type: list of stringDefault: basicModels_nameListpiecewise: if consider custom a piecewise function. It is mandatory not to 'piecewise' when the data size is less than 20.Type: boolDefault: Falseoperator: operatation between basic models.Type: stringDefault: '+'maxCombination: max number of combination of basic models.Type: integerDefault: 2plot_opt: the number of plot for optimal models.Type: integerDefault: 10xscale: one of {"linear", "log", "symlog", "logit", ...}Type: stringDefault: Noneyscale: one of {"linear", "log", "symlog", "logit", ...}Type: stringDefault: Nonefilename_startwith: a custom string mark as part of output filenameType: stringDefault: 'curvefit'silent: minimal output to monitorType: booleanDefault: Falsefeedback: if True, return the optimal model(function object), parametersType: booleanDefault: Falsekwargs: keyword arguments passed tocurve_fit_m. Note thatboundsandp0will take no effect when multi-models.Type: dictSee the complete example "/tests/curvefitting.py".Generate a expected modelCreate 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 curveSee the complete example "/tests/reuse_the_fitted_model.py".ShortagesBased onscipy.optimize.least_squares, it cannot enhance the estimate of specified model. Evenmore, it has more limit thanscipy.optimize.least_squares.
For example, arguments ofbounds,x0orp0were not supported due to thebasic hypothesis.How to citeIf this tool is useful to your research,starand cite it as below:Xiaolong Liu, & Meixiu Yu. (2020, June 14). longavailable/adaptive-curvefitting. Zenodo. 
http://doi.org/10.5281/zenodo.3893596Easily, you can import it toMendeley.Changelogv0.1.3First release.v0.1.4AddqueryModel()to simplify the reuse of a fitted model.Replacefrom scipy._lib._util import getargspec_no_self as _getargspecwithfrom ._helpers import funcArgsNrv0.1.5Updated the outdated module of sci.