Skip to main content

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

Project description

Run and scale time-series machine learning in the Cloud


functime

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


functime is a powerful and easy-to-use Cloud service for AutoML forecasting and time-series embeddings. The functime Python package provides a scikit-learn API and command-line interface to interact with functime Cloud.

Want to use functime for seamless time-series analytics across your data team? Looking for fully-managed production-grade AI/ML forecasting and time-series search? Book a 15 minute discovery call to learn more about functime's Team / Enterprise plans.

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
  • Utilities to add calendar effects, special events (e.g. holidays), weather patterns, and economic trends
  • Supports recursive, direct, and ensemble forecast strategies

Note: All preprocessors, time-series splitters, and forecasting metrics are implemented with Polars and open-sourced under the Apache-2.0 license. Contributions are always welcome.

Getting Started

  1. First, install functime via the pip package manager.
pip install functime
  1. Then sign-up for a free functime Cloud account via the command-line interface (CLI).
functime login
  1. That's it! You can begin forecasting at scale using functime's scikit-learn fit-predict API.
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://bit.ly/commodities-data")
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)

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

All predictions and scores are returned as Polars DataFrames.

>>> y_pred
shape: (213, 3)
┌────────────────┬─────────────────────┬─────────────┐
│ commodity_type ┆ time                ┆ price       │
│ ---            ┆ ---                 ┆ ---         │
│ str            ┆ datetime[ns]        ┆ f64         │
╞════════════════╪═════════════════════╪═════════════╡
│ Wheat, US HRW  ┆ 2023-01-01 00:00:00 ┆ 240.337497  │
│ Wheat, US HRW  ┆ 2023-02-01 00:00:00 ┆ 250.851552  │
│ Wheat, US HRW  ┆ 2023-03-01 00:00:00 ┆ 252.102028  │
│ Beef           ┆ 2023-01-01 00:00:00 ┆ 4.271976    │
│ …              ┆ …                   ┆ …           │
└────────────────┴─────────────────────┴─────────────┘

>>> scores.sort("mase")
shape: (71, 2)
┌──────────────────────┬────────────┐
│ commodity_type       ┆ mase       │
│ ---                  ┆ ---        │
│ str                  ┆ f64        │
╞══════════════════════╪════════════╡
│ Rice, Viet Namese 5% ┆ 0.308148   │
│ Palm kernel oil      ┆ 0.554886   │
│ Coconut oil          ┆ 1.051424   │
│ Cocoa                ┆ 1.32211    │
│ …                    ┆ …          │
└──────────────────────┴────────────┘

Deployment

functime deploys and trains your forecasting models the moment you call any .fit method. Run the functime list CLI command to list all deployed models. To view data and forecasts usage, run the functime usage CLI command.

Example CLI usage

You can reuse a deployed model for predictions anywhere using the stub_id variable.

forecaster = LinearModel.from_deployment(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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

functime-0.1.6-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for functime-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2041f74e32fff20fc9a21de991ac17fc4fef6089148889f71c4fa22ea5b4e9
MD5 f3436e078ffcfca0bdeb6cf80e757e06
BLAKE2b-256 2ae060c5db386e0e2784b0e6abe92dc07e613a546a98a5415d9b8f594e780b4b

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