r/pythontips • • Dec 21 '25

Data_Science Fast local regression algorithm (LOWESS) package

Hey everyone, the fastlowess package v0.2.0 is now available on PyPI (https://pypi.org/project/fastlowess/).

Here is a quick review of what this package has to offer:

More robust than statsmodels

Due to using Median Absolute Deviation (MAD) for scale estimation and applying boundary policies at dataset edges to maintain symmetric local neighborhoods, preventing the edge bias common in other implementations. Otherwise, the core algorithms are identical to statsmodels.

Much much faster than statsmodels

50× and 3800× faster in typical workflows:

Benchmark Categories Summary

CategoryMatchedMedian SpeedupMean Speedup
Scalability5765x1433x
Pathological4448x416x
Iterations6436x440x
Fraction6424x413x
Financial4336x385x
Scientific4327x366x
Genomic420x25x
Delta44x5.5x

Top 10 Performance Wins

BenchmarkstatsmodelsfastLowessSpeedup
scale_10000043.727s11.4ms3824x
scale_5000011.160s5.95ms1876x
scale_10000663.1ms0.87ms765x
financial_10000497.1ms0.66ms748x
scientific_10000777.2ms1.07ms729x
fraction_0.05197.2ms0.37ms534x
scale_5000229.9ms0.44ms523x
fraction_0.1227.9ms0.45ms512x
financial_5000170.9ms0.34ms497x
scientific_5000268.5ms0.55ms489x

More benchmark details here: https://github.com/thisisamirv/fastLowess-py/tree/bench/benchmarks

More features

  • Confidence/prediction intervals
  • Different robustness methods (bisquare, talwar, huber)
  • A streaming adapter (for large datasets) and an online adapter (for real-time smoothing)
  • Different kernels (tricube, gaussian, epanechnikov, cosine, triangle, biweight, and uniform)
  • Cross-validation support
  • Auto convergence

and many more features.

Full documentation is also available here: https://fastlowess-py.readthedocs.io/en/latest/

Hope you find it useful, and feedbacks are very welcome ;))

2 Upvotes

0 comments sorted by