Scalable time series processing
Project description
autotimeseries
Nixtla SDK. Time Series Forecasting pipeline at scale.
autotimeseries is a python SDK to consume the APIs developed in https://github.com/Nixtla/nixtla.
Install
PyPI
pip install autotimeseries
How to use
Check the following examples for a full pipeline:
Basic usage
import os
from autotimeseries.core import AutoTS
autotimeseries = AutoTS(bucket_name=os.environ['BUCKET_NAME'],
api_id=os.environ['API_ID'],
api_key=os.environ['API_KEY'],
aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'],
aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'])
Upload dataset to S3
train_dir = '../data/m5/parquet/train'
# File with target variables
filename_target = autotimeseries.upload_to_s3(f'{train_dir}/target.parquet')
# File with static variables
filename_static = autotimeseries.upload_to_s3(f'{train_dir}/static.parquet')
# File with temporal variables
filename_temporal = autotimeseries.upload_to_s3(f'{train_dir}/temporal.parquet')
Each time series of the uploaded datasets is defined by the column item_id
. Meanwhile the time column is defined by timestamp
and the target column by demand
. We need to pass this arguments to each call.
columns = dict(unique_id_column='item_id',
ds_column='timestamp',
y_column='demand')
Send the job to make forecasts
response_forecast = autotimeseries.tsforecast(filename_target=filename_target,
freq='D',
horizon=28,
filename_static=filename_static,
filename_temporal=filename_temporal,
objective='tweedie',
metric='rmse',
n_estimators=170,
**columns)
Download forecasts
autotimeseries.download_from_s3(filename='forecasts_2021-10-12_19-04-32.csv', filename_output='../data/forecasts.csv')
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
autotimeseries-0.0.5.tar.gz
(15.3 kB
view hashes)
Built Distribution
Close
Hashes for autotimeseries-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc6bb313e2dbf1a6889b77b61af36964c0715df7d096104c5fe20acbdefce22 |
|
MD5 | 5d3a9f5af769b8b96835a196fc44099b |
|
BLAKE2b-256 | dcb0fc0eddf9b9848ee7596255bf18fabf472eba36e20661799e9d3e4cb43666 |