Skip to main content

Python's forecast::auto.arima equivalent

Project description

pmdarima

PyPI version CircleCI Github Actions Status codecov Supported versions Downloads Downloads/Week

Pmdarima (originally pyramid-arima, for the anagram of 'py' + 'arima') is a statistical library designed to fill the void in Python's time series analysis capabilities. This includes:

  • The equivalent of R's auto.arima functionality
  • A collection of statistical tests of stationarity and seasonality
  • Time series utilities, such as differencing and inverse differencing
  • Numerous endogenous and exogenous transformers and featurizers, including Box-Cox and Fourier transformations
  • Seasonal time series decompositions
  • Cross-validation utilities
  • A rich collection of built-in time series datasets for prototyping and examples
  • Scikit-learn-esque pipelines to consolidate your estimators and promote productionization

Pmdarima wraps statsmodels under the hood, but is designed with an interface that's familiar to users coming from a scikit-learn background.

Installation

Pmdarima has binary and source distributions for Windows, Mac and Linux (manylinux) on pypi under the package name pmdarima and can be downloaded via pip:

$ pip install pmdarima

Quickstart Examples

Fitting a simple auto-ARIMA on the wineind dataset:

import pmdarima as pm
from pmdarima.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt

# Load/split your data
y = pm.datasets.load_wineind()
train, test = train_test_split(y, train_size=150)

# Fit your model
model = pm.auto_arima(train, seasonal=True, m=12)

# make your forecasts
forecasts = model.predict(test.shape[0])  # predict N steps into the future

# Visualize the forecasts (blue=train, green=forecasts)
x = np.arange(y.shape[0])
plt.plot(x[:150], train, c='blue')
plt.plot(x[150:], forecasts, c='green')
plt.show()
Wineind example

Fitting a more complex pipeline on the sunspots dataset, serializing it, and then loading it from disk to make predictions:

import pmdarima as pm
from pmdarima.model_selection import train_test_split
from pmdarima.pipeline import Pipeline
from pmdarima.preprocessing import BoxCoxEndogTransformer
import pickle

# Load/split your data
y = pm.datasets.load_sunspots()
train, test = train_test_split(y, train_size=2700)

# Define and fit your pipeline
pipeline = Pipeline([
    ('boxcox', BoxCoxEndogTransformer(lmbda2=1e-6)),  # lmbda2 avoids negative values
    ('arima', pm.AutoARIMA(seasonal=True, m=12,
                           suppress_warnings=True,
                           trace=True))
])

pipeline.fit(train)

# Serialize your model just like you would in scikit:
with open('model.pkl', 'wb') as pkl:
    pickle.dump(pipeline, pkl)

# Load it and make predictions seamlessly:
with open('model.pkl', 'rb') as pkl:
    mod = pickle.load(pkl)
    print(mod.predict(15))
# [25.20580375 25.05573898 24.4263037  23.56766793 22.67463049 21.82231043
# 21.04061069 20.33693017 19.70906027 19.1509862  18.6555793  18.21577243
# 17.8250318  17.47750614 17.16803394]

Availability

pmdarima is available on PyPi in pre-built Wheel files for Python 3.5+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (32 & 64-bit)

If a wheel doesn't exist for your platform, you can still pip install and it will build from the source distribution tarball, however you'll need cython>=0.29 and gcc (Mac/Linux) or MinGW (Windows) in order to build the package from source.

Note that legacy versions (<1.0.0) are available under the name "pyramid-arima" and can be pip installed via:

# Legacy warning:
$ pip install pyramid-arima
# python -c 'import pyramid;'

However, this is not recommended.

Documentation

All of your questions and more (including examples and guides) can be answered by the pmdarima documentation. If not, always feel free to file an issue.

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

pmdarima-1.6.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pmdarima-1.6.0-cp38-cp38-win_amd64.whl (605.1 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.6.0-cp38-cp38-win32.whl (546.8 kB view details)

Uploaded CPython 3.8Windows x86

pmdarima-1.6.0-cp38-cp38-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8

pmdarima-1.6.0-cp38-cp38-macosx_10_15_x86_64.whl (607.8 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.6.0-cp37-cp37m-win_amd64.whl (599.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.6.0-cp37-cp37m-win32.whl (541.1 kB view details)

Uploaded CPython 3.7mWindows x86

pmdarima-1.6.0-cp37-cp37m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m

pmdarima-1.6.0-cp37-cp37m-macosx_10_15_x86_64.whl (603.1 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.6.0-cp36-cp36m-win_amd64.whl (599.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.6.0-cp36-cp36m-win32.whl (540.8 kB view details)

Uploaded CPython 3.6mWindows x86

pmdarima-1.6.0-cp36-cp36m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m

pmdarima-1.6.0-cp36-cp36m-macosx_10_15_x86_64.whl (602.4 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

pmdarima-1.6.0-cp35-cp35m-win_amd64.whl (595.3 kB view details)

Uploaded CPython 3.5mWindows x86-64

pmdarima-1.6.0-cp35-cp35m-win32.whl (538.3 kB view details)

Uploaded CPython 3.5mWindows x86

pmdarima-1.6.0-cp35-cp35m-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.5m

pmdarima-1.6.0-cp35-cp35m-macosx_10_15_x86_64.whl (596.4 kB view details)

Uploaded CPython 3.5mmacOS 10.15+ x86-64

File details

Details for the file pmdarima-1.6.0.tar.gz.

File metadata

  • Download URL: pmdarima-1.6.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for pmdarima-1.6.0.tar.gz
Algorithm Hash digest
SHA256 22577b065a23f7e21ed07eaab9b1db50a96308a2db3fe2f59e4208018df985f4
MD5 1cd82b209bf8cbf24c9d194351c5d10a
BLAKE2b-256 4345cc79a6d1614a1679e7cedecc94163e0fa09ca66bd264507308e035cf15f5

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 605.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7e234aa55af0369ba2c4f40e7e819dd2262ebc40f2a3aae1ac81160b5e6939f9
MD5 817c3acd722b612c0cb4e13def0381b1
BLAKE2b-256 f6691b37338f79fdf4ca3de751c725c3549151773618abc5352e3d639b5fb2d6

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 546.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 ef4dfdbcf15b8aecfa8c48a2aa92aeb0a327ee1505afbcd50cb0fb1020b80036
MD5 53fdd4b4c378b687a6061d745c427a22
BLAKE2b-256 2f8bd4b67434a985abdab2cb84c2954d5091902fb919ac60ee54fca61fa3954d

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b1e1175f83a408d56da70e426ac7eb2232ec524abb51d93512da54b296ee99f6
MD5 15b4cb73aa7dc2cd24cd24fc71d875cc
BLAKE2b-256 9de456e2e5404238be5b85706305a1960921d619cad56fdd767e3368d0f79044

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 607.8 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 46476046c05c7fb911caa882821c5351644318c6f048d13aad2650b34265fc8f
MD5 b1716c5be79cdbc686aad7315692f02b
BLAKE2b-256 805413faf7052b21a6d2e6c216c404ff354107aaf744834d302fbb9f871391d0

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 599.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for pmdarima-1.6.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 aa05ac587a40ee369c8aa909dd90af1746ae46e9b6b70cf15a6fbad9fc301231
MD5 aa1a20e44f12adc80b43c96e388459f6
BLAKE2b-256 f208d0684c9eee03fd793ee6092287ed7c5d6e5eb2076073655bf276fd6ea130

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 541.1 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for pmdarima-1.6.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 d85fe900563febfb1ed0e28e37dfb06d936ca50627f62a4cf942d5a46e3fce8c
MD5 437256cbe15627d1eb9a9e29a60fc5ac
BLAKE2b-256 19f49083402f3d496ebbfb2b52e2c903c09f268ecd7a25ecd3259f1e1a75b724

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4f5cfadf94baf8ce8550f5938f962b542e40c3ba7644f1d4f328eaa8c025bbb6
MD5 da8f0760d55515df2a35b17b52b95be0
BLAKE2b-256 77187c087aa667eb5bb07c8d9cdeaee3a1a7ff127ce058e8e4e83764c7efd496

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 603.1 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for pmdarima-1.6.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 98a1de44d537d90058b704e4ac3387054a9fcb11e749d809a8b5ca41d74e47ec
MD5 c8844f311987ae237ea1dc0be09a42d1
BLAKE2b-256 6a0f4b02c0a3a72bea752936c7b17b14da6103b9da1b0fddc23a8b847760e27f

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 599.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.6.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 733e7216d002105c50bd0a2f0528360b6eaec180411403918007d532e2581630
MD5 9096fd329ee9f67aaf2983d0ab41b8e7
BLAKE2b-256 4e7581b2b3a3f531d583ef11002500d8b35899b6137c69beec298fbd32034f64

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 540.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.6.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 70d86dd2a459207f199500067bde12e36d4f567cd1bb5efddb1686dd72d044cb
MD5 78fa112ea3afe4dd9f3fab448cc7852c
BLAKE2b-256 d12993bffaf25495ecc0304551d2c23ed6e2082ce0bc4572701379e9ae4e7788

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f77297c7a2b1b61a554eafb0658147526b077778317e1ffdd599c3428bd51b57
MD5 92e06b48e11e6e5af13cf65a040a1c28
BLAKE2b-256 ff077c173cc4fee44ebd62ddf03b3de84c4f151ec23facdf16baf58b8d02784c

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 602.4 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for pmdarima-1.6.0-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c24ae8f9e580aac3bf249f4db0a689946beab7e66391330b56579e237cea37bc
MD5 e3ad6df5f7d75983c7ae147f2b8bad44
BLAKE2b-256 e48806271163845ac0964030100b4432d79faf02d55820ea377410904e74f7dc

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 595.3 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.4

File hashes

Hashes for pmdarima-1.6.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 31bd9de9c10d06f2b4121f7931fcc3ada07d9935a6d4169cf5fe4fbfc36ce996
MD5 87dc4339aba2eb0565e5c94db440d7fa
BLAKE2b-256 6fc5f4426f9fafafc05b3913bb4a2dab9e99201e0a2ae55c5190cc6233dd998b

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp35-cp35m-win32.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 538.3 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.4

File hashes

Hashes for pmdarima-1.6.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 938ad9c2ce9c7c5655ff741f0f54e85dc1bce7ba4fa7763f7acafb38c85140ee
MD5 7879c3ead95a2ec88d9beffe6ce6c59c
BLAKE2b-256 56cdbc08640c02162ef5814c16b4afb80b0439fb586cf6228893cde3381b2959

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f2e8a71453a9d8dab77a1e2400ec12adeb590acad6d0a03950be483d4dc0aaeb
MD5 fa89177c0f3a0085214e4c0a08d43781
BLAKE2b-256 13b6abf8a660c1e6c127ad6f06af53c6194cc5fb816d5f0f993892aea50a10ba

See more details on using hashes here.

File details

Details for the file pmdarima-1.6.0-cp35-cp35m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.6.0-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 596.4 kB
  • Tags: CPython 3.5m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.9

File hashes

Hashes for pmdarima-1.6.0-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5a679be78ebc5bfb99af0c8d4e5d34b9c526d38b2d72081db08fc5cbf1336148
MD5 04829b008ee7e71a96b5d0454d88fabd
BLAKE2b-256 84c18af218a448015ac51fb3747ea0638dc953874d864813e3352df5f03c5e79

See more details on using hashes here.

Supported by

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