The easiest way to run and scale time-series machine learning in the Cloud.
Project description
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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file functime-0.5.1.tar.gz
.
File metadata
- Download URL: functime-0.5.1.tar.gz
- Upload date:
- Size: 63.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61253f11a479c4fdae7111aaedcae071a9ebb3c089792527c45bf05daa9aa25f |
|
MD5 | fbc5da835f378161dc59c55d7ac89e8c |
|
BLAKE2b-256 | eacf1c1f5d492125bfc554155f250a5ee638c5a73136ba388bc20ada2ab349db |
File details
Details for the file functime-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: functime-0.5.1-py3-none-any.whl
- Upload date:
- Size: 69.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6561c5f3a807d6b9708abfdda037f28dfa64779cf05d117274e2a25850e689b3 |
|
MD5 | 2d9e33d29f6f683adb2121fb8531adcb |
|
BLAKE2b-256 | 875a6bea3fbedc5682a85ad1bb44132f88baabf9e82ea09db8aaa9fed515be1f |