Python or SQL Logistic Regression

若如初见. 提交于 2019-12-06 14:48:03

问题


Given time-series data, I want to find the best fitting logarithmic curve. What are good libraries for doing this in either Python or SQL?

Edit: Specifically, what I'm looking for is a library that can fit data resembling a sigmoid function, with upper and lower horizontal asymptotes.


回答1:


If your data were categorical, then you could use a logistic regression to fit the probabilities of belonging to a class (classification).

However, I understand you are trying to fit the data to a sigmoid curve, which means you just want to minimize the mean squared error of the fit.

I would redirect you to the SciPy function called scipy.optimize.leastsq: it is used to perform least squares fits.



来源:https://stackoverflow.com/questions/3754051/python-or-sql-logistic-regression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!