Git Product home page Git Product logo

functime's Introduction

Time-series machine learning and embeddings at scale


functime Python PyPi Code style: black GitHub Publish to PyPI GitHub Build Docs GitHub Run Quickstart


functime is a powerful Python library for production-ready AutoML forecasting and temporal embeddings.

functime also comes with time-series preprocessing (box-cox, differencing etc), cross-validation splitters (expanding and sliding window), and forecast metrics (MASE, SMAPE etc). All optimized as lazy Polars transforms.

Want to use functime for seamless time-series predictive analytics across your data team? Looking for production-grade time-series AutoML in a serverless Cloud deployment? Shoot Chris a message on LinkedIn to learn more about functime Cloud.

Highlights

  • Fast: Forecast 100,000 time series in seconds on your laptop
  • Efficient: Embarrassingly parallel feature engineering for time-series using Polars
  • Battle-tested: Machine learning algorithms that deliver real business impact and win competitions
  • Exogenous features: supported by every forecaster
  • Backtesting with expanding window and sliding window splitters
  • AutoML: Automated lags and hyperparameter tuning using FLAML
  • Censored model: for zero-inflated and thresholding forecasts

Getting Started

Install functime via the pip package manager.

pip install functime

Forecasting

import polars as pl
from functime.cross_validation import train_test_split
from functime.forecasting import lightgbm
from functime.metrics import mase

# Load example data
y = pl.read_parquet("https://github.com/descendant-ai/functime/raw/main/data/commodities.parquet")
entity_col, time_col = y.columns[:2]

# Time series split
y_train, y_test = y.pipe(train_test_split(test_size=3))

# Fit-predict
model = lightgbm(freq="1mo", lags=24, max_horizons=3, strategy="ensemble")
model.fit(y=y_train)
y_pred = model.predict(fh=3)

# functime ❤️ functional design
# fit-predict in a single line
y_pred = lightgbm(freq="1mo", lags=24)(y=y_train, fh=3)

# Score forecasts in parallel
scores = mase(y_true=y_test, y_pred=y_pred, y_train=y_train)

Serverless Deployment

Currently in closed-beta for functime Teams. Contact us for a demo via Calendly.

Deploy and train forecasters the moment you call any .fit method. Run the functime list CLI command to list all deployed models. Finally, track data and forecasts usage using functime usage CLI command.

Example CLI usage

You can reuse a deployed model for predictions anywhere using the stub_id variable. Note: the .from_deployed model class must be the same as during .fit.

forecaster = LightGBM.from_deployed(stub_id)
y_pred = forecaster.predict(fh=3)

License

functime is distributed under AGPL-3.0-only. For Apache-2.0 exceptions, see LICENSING.md.

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.