Skip to main content

The easiest way to run and scale time-series machine learning in the Cloud.

Project description

Time-series machine learning 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 global forecasting and time-series feature engineering.

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 machine learning in a serverless Cloud deployment? Contact us via Calendly 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
  • Automated lags and hyperparameter tuning using FLAML
  • Censored forecaster: 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.feature_extraction import add_fourier_terms
from functime.forecasting import linear_model
from functime.preprocessing import scale
from functime.metrics import mase

# Load commodities price 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
forecaster = linear_model(freq="1mo", lags=24)
forecaster.fit(y=y_train)
y_pred = forecaster.predict(fh=3)

# functime ❤️ functional design
# fit-predict in a single line
y_pred = linear_model(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)

# Forecast with target transforms and feature transforms
forecaster = linear_model(
    freq="1mo",
    lags=24,
    target_transform=scale(),
    feature_transform=add_fourier_terms(sp=12, K=6)
)

View the full walkthrough on forecasting with functime.

Serverless Deployment

Currently in closed-beta for functime Cloud. 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 Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

functime-0.5.2.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

functime-0.5.2-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file functime-0.5.2.tar.gz.

File metadata

  • Download URL: functime-0.5.2.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for functime-0.5.2.tar.gz
Algorithm Hash digest
SHA256 daa4af0ce15cfe3a74bedcc8f52be3bc28dc49a0f4c676ce0c0ddaf64af6ff08
MD5 d751cb62218c633f3a5e54e6f06d0616
BLAKE2b-256 d69c08f7e16a45282a0541d3a2fe6c700d2e539d8078f1e62318627967ca6309

See more details on using hashes here.

File details

Details for the file functime-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: functime-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for functime-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43216b1c1f7644ad421744a6fc0035a615443738bf0aed69f6feddc2ab87feab
MD5 2cc297da0c511f7798c306b818f80281
BLAKE2b-256 cba2edbe1bd4cf6e57fd843e854c24117256e34100866176b1f8483cc1ca8e64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page