Giter Site home page Giter Site logo

anbowell / whittaker-eilers Goto Github PK

View Code? Open in Web Editor NEW
26.0 1.0 2.0 306 KB

A sparse matrix implementation of Whittaker-Eilers smoothing and interpolation

Home Page: https://crates.io/crates/whittaker-eilers

Rust 47.64% MATLAB 9.40% Python 42.97%
algorithms interpolation smoother time-series

whittaker-eilers's Introduction

Hi there ๐Ÿ‘‹

I'm Andrew, a developer from the UK with a love for mathematical programming.

Projects

  • ๐Ÿป Beer Near: A beer based compass that points towards your nearest pub. Available on both Android and iOS.
  • ๐Ÿ›  Dev toolbox: A collection of online tools to quickly convert and validate a variety of formats.
  • ๐Ÿ“ˆ Whittaker Smoother: A Rust implmentation of the Whittaker-Eilers smoother with Python bindings.
  • ๐Ÿ“š Blog: A collection of articles about software development and physics.
  • ๐Ÿ“‚ S3-filesystem: A Rust crate to treat S3 files as if they were local files.

To get in touch,feel free message me here


Top Langs

whittaker-eilers's People

Contributors

anbowell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tdl77 colinahill

whittaker-eilers's Issues

Question about usage

Thanks for this package -- I am trying it out as a replacement for LOWESS, and it seems promising.

I've written this function as a wrapper to work with a pandas Series:

    from whittaker_eilers import WhittakerSmoother

    def make_whittaker_eilers(series):
        """Compute a smooth line.

        series: pd.Series

        returns: pd.Series
        """
        y = series.values
        x = series.index.values

        whittaker_smoother = WhittakerSmoother(
            lmbda=1e4, order=3, data_length=len(y), x_input=x
        )

        smooth = whittaker_smoother.smooth(y)

        return pd.Series(smooth, index=x)

One of the datasets I'm working with has unevenly spaced points, so I'm providing the x values as x_input.

But now I would like to evaluate the smooth function at equally spaced points -- I was expecting a parameter like x_output to indicate where the function should be evaluated, but it looks like it doesn't exist.

Is there another way to do this?

python: ImportError: cannot import name 'Whittaker' from 'whittaker_eilers'

Hi,

I am trying to use this package. The error I am getting is as follows.
Traceback (most recent call last):
File "/home/pranav/epat/stockbot/regression_strategy_test.py", line 9, in
from whittaker_eilers import Whittaker
ImportError: cannot import name 'Whittaker' from 'whittaker_eilers' (/home/pranav/.virtualenvs/regressiontest/lib/python3.11/site-packages/whittaker_eilers/init.py)

My code is below.

from whittaker_eilers import Whittaker
whittaker_smoother = WhittakerSmoother(lmbda=20,order=2,data_length=len(df["close"]))
	smoothed_prices = whittaker_smoother.smooth(df["close"])


```What am I doing wrong?

a few observations

This is excellent!

I have a few observations:

The Python docstring for the main class, for some reason, is not displayed in the contextual help in VSCode in a Jupyter Notebook. It does show in the popup help. This must be some subtle formatting issue, not sure.

The lmbda parameter name should be re-done. It's not worth saving one keystroke there. Just call it lambda.

It might be perhaps helpful to set default values for lambda and order. I'm not sure here, but it seems like it could benefit the ease of utilization.

Thank you for the excellent package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.