Giter Site home page Giter Site logo

diku-dk / hastl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mortvest/hastl

0.0 1.0 0.0 37.79 MB

HaSTL: A fast GPU implementation of STL decomposition with missing values and support for both CUDA and OpenCL

License: MIT License

Python 97.29% Makefile 2.71%

hastl's Introduction

HaSTL

HaSTL [ˈheɪstiɛl]: A fast GPU implementation of batched Seasonal and Trend decomposition using Loess (STL) [1] with missing values and support for both CUDA and OpenCL (C and multicore backends are also available). Loosely based on stlplus, a popular library for the R programming language. The GPU code is written in Futhark, a functional language that compiles to efficient parallel code.

Requirements

You would need a working OpenCL or CUDA installation/header files, C compiler and these Python packages:

  • futhark-ffi==0.14.2
  • wheel

Installation

You may want to run the program in a Python virtual environment. Create it via:

python -m venv env

Then, activate the virtual environment via:

. env/bin/activate

Upgrade pip via:

pip install --upgrade pip

Then select the backends (choose from opencl, cuda, c and multicore) that you wish to build by setting the environment variable:

export HASTL_BACKENDS="opencl multicore c" 

If no environmental variable is set, only the sequential c backend would be compiled.

The package can then be easily installed using pip. This will take a while, since we need to compile the shared libraries for your particular system, Python implementation and all selected backends:

pip install hastl

To install the package from the sources, first get the current stable release via:

git clone https://github.com/mortvest/hastl

Install the dependencies via:

pip install -r requirements.txt

Afterwards, you can install the package. This can also take a while:

python setup.py sdist bdist_wheel
pip install .

Usage

Examples of HaSTL usage can be found in the examples/ direcotry. The simplest snippet should contain:

from hastl import STL
stl = STL(backend=..)
seasonal, trend, remainder = stl.fit(data, n_p=.., q_s=..)

References

[1] Cleveland, Robert B., et al. "STL: A seasonal-trend decomposition." J. Off. Stat 6.1 (1990): 3-73.

hastl's People

Contributors

mortvest avatar

Watchers

 avatar

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.