Skip to main content
Pypi Version https://img.shields.io/pypi/pyversions/magi.svg https://readthedocs.org/projects/magi-docs/badge/?version=latest License Join the chat at https://gitter.im/magi-gitter/Lobby https://beerpay.io/DavisTownsend/magi/make-wish.svg?style=plastic

Overview

magi is a high level python wrapper around other time series forecasting libraries to allow easily parallelized univariate time series forecasting in python by using dask delayed wrapper functions under the hood. In particular, the library currently supports wrappers to R forecast library and facebook’s prophet package

Usage

This is how easy it is to clean, forecast, and then plot accuracy metrics for 100 time seres using the auto arima model from R forecast package

Importing libraries, generate dataframe of series for example, and start local dask cluster

from magi.core import forecast
from magi.plotting import fc_plot, acc_plot
from magi.utils import gen_ts
from magi.accuracy import accuracy
from dask.distributed import Client, LocalCluster
import dask
cluster = LocalCluster()
client = Client(cluster)
df = gen_ts(ncols=100)

cleaning and forecasting for 100 series in parallel, then calculate and plot accuracy metrics by series

fc_obj = forecast(time_series=df,forecast_periods=18,frequency=12)
forecast_df = fc_obj.tsclean().R(model='auto.arima(rdata,D=1,stationary=TRUE)',fit=True)
acc_df = accuracy(df,forecast_df,separate_series=True)
acc_plot(acc_df)

Use Cases

What this package should be used for

  • forecasting for 1 or more Univariate Time Series

  • forecasting using many different time series models in parallel with minimal effort

  • wrapper for R forecast library to implement those models in python workflow

  • wrapper around Prophet library to provide easier data framework to work with

  • single source of access for many different time series forecasting models

What this package should NOT be used for

  • Multivariate Time Series data. If you have multiple x variables that are correlated with your response variable, I’d suggest simply using regression with lags and seasonal variable to account for autocorrelation in your error

  • Data exploration - The time series analysis step is much more suited to using the R forecast package directly

Dependencies

  • dask

  • distributed

  • plotly

  • cufflinks

  • rpy2 (& forecast package >=8.3 installed in R)

  • fbprophet

Installation

$ pip install magi

Documentation

Documentation is hosted on Read the Docs.

Disclaimer

This package is still very early in development and should not be relied upon in production. Everything is still subject to change

Release files for magi 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magi 0.0.17
File Size Uploaded
magi-0.0.17.tar.gz 11.2 kB Details

Release files / magi-0.0.17.tar.gz

Download URL magi-0.0.17.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87ebb3f9914d69896d882a8a2d1d30dd44e695fa5d4b887d22466c880e66b3bd
BLAKE2b-256 checksum
How to use checksums
bf76422823fdbe47e4b16b9d3ed014a0c4bef12d324896008861520971b1a7ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.17 This release

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page