News for hackers. Stuff that matters.
Re:Python library for univariate regression, interpolation, ... by codeboy7432 on Monday August 29, 2022 @07:58PM (#32645065)
I authored this package as I needed to generate confidence intervals for time series data without using SciPy. Sharing this here, as this could be a useful package for others :)

Included Models: - Linear regression - Ridge regression - Linear spline - Isotonic regression - Bin regression - Cubic spline - Natural cubic spline - Exponential moving average - Kernel functions (Gaussian, KNN, Weighted average)

Re:Python library for univariate regression, interpolation, ... by gkhartman on Monday August 29, 2022 @09:00PM (#32645489)
Thanks for releasing this. I was just wondering if something like this exists. I've worked on a few projects where scipy was banned due to the large dependencies it pulls in.
Re:Python library for univariate regression, interpolation, ... by clircle on Monday August 29, 2022 @09:27PM (#32645681)
Have you compared these to StatsModels? Or R? (which includes most of these ootb)
Re:Python library for univariate regression, interpolation, ... by codeboy7432 on Tuesday August 30, 2022 @12:04PM (#32651972)
I did look into stats models, but this was a large library with more than I needed. I did not look into R.. Are there any lightweight alternatives in this language?
Re:Python library for univariate regression, interpolation, ... by clircle on Tuesday August 30, 2022 @05:45PM (#32655559)
I think most or all of these models are in the R Standard lib
Re:Python library for univariate regression, interpolation, ... by wdkrnls on Tuesday August 30, 2022 @07:10PM (#32656369)
Not all as far as I know. For ridge regression you will want to install glmnet, for example. mgcv which is usually shipped with R provides access to a few common fast kernels which seem to be the ones python programmers are familiar with.
Re:Python library for univariate regression, interpolation, ... by clircle on Tuesday August 30, 2022 @08:36PM (#32656953)
Can use lm.ridge from MASS instead of glmnet, but yeah there’s going to be some smoother not in R standard library
Re:Python library for univariate regression, interpolation, ... by wdkrnls on Tuesday August 30, 2022 @07:13PM (#32656389)
mgcv also provides many more varieties of splines than base R.
Re:Python library for univariate regression, interpolation, ... by iamcreasy on Monday August 29, 2022 @10:23PM (#32645956)
Am I guess correct to assume that you could not use sklearn/scikit as well because it depends on SciPy? (I am under the impression that sklearn/scikit is the dominant library for an implementation of these algorithms.)
Re:Python library for univariate regression, interpolation, ... by codeboy7432 on Tuesday August 30, 2022 @12:01PM (#32651928)
That is correct. I had to generate confidence intervals on over 8000 univariate data sets using very small VMs, so I needed to limit large dependancies as much as I could. This package was the result of this!
Re:Python library for univariate regression, interpolation, ... by t6jvcereio on Monday August 29, 2022 @08:34PM (#32645340)
Two questions:

Why the requirement that you can't use scipy?

Have you heard of the package stats model?

Re:Python library for univariate regression, interpolation, ... by versteegen on Monday August 29, 2022 @08:39PM (#32645360)
Well, SciPy depends heavily on NumPy, which as a CPython-specific extension won't run on other Python interpreters in general. Although for example there is ulab for MicroPython which replicates part of NumPy, and PyPy has a compatibility layer for CPython extensions.

Edit: well, Regessio itself also depends on NumPy, but might be able to run on top of ulab whereas I really doubt SciPy would.

Re:Python library for univariate regression, interpolation, ... by nothrowaways on Tuesday August 30, 2022 @03:09AM (#32647488)
The repo on OP also depends on numpy
Re:Python library for univariate regression, interpolation, ... by t6jvcereio on Tuesday August 30, 2022 @08:50AM (#32649722)
Responding that there's something out there called ulab doesn't really answer my question, which was: where does op's requirement to not use scipy come from.
Re:Python library for univariate regression, interpolation, ... by codeboy7432 on Tuesday August 30, 2022 @12:08PM (#32652031)
(Same as comment above)

".. I had to generate confidence intervals on over 8000 univariate data sets using very small VMs, so I needed to limit large dependancies as much as I could. This package was the result of this!"

Based on the comments in this thread, it may be worth trying to make this package not dependant on Numpy as well?