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.7.1.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.7.1-cp38-cp38-win_amd64.whl (614.1 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.7.1-cp38-cp38-win32.whl (555.8 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.8

pmdarima-1.7.1-cp38-cp38-macosx_10_15_x86_64.whl (616.1 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.7.1-cp37-cp37m-win_amd64.whl (608.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.7.1-cp37-cp37m-win32.whl (549.9 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7m

pmdarima-1.7.1-cp37-cp37m-macosx_10_15_x86_64.whl (611.4 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.7.1-cp36-cp36m-win_amd64.whl (608.0 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.7.1-cp36-cp36m-win32.whl (549.7 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

pmdarima-1.7.1-cp36-cp36m-macosx_10_15_x86_64.whl (610.9 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

pmdarima-1.7.1-cp35-cp35m-win_amd64.whl (604.3 kB view details)

Uploaded CPython 3.5mWindows x86-64

pmdarima-1.7.1-cp35-cp35m-win32.whl (547.4 kB view details)

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

pmdarima-1.7.1-cp35-cp35m-macosx_10_15_x86_64.whl (605.3 kB view details)

Uploaded CPython 3.5mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.7.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1.tar.gz
Algorithm Hash digest
SHA256 b187a6524a470a1cc5866083c0c9e3f18a14037d99936d55d7474e48f4ea451e
MD5 3f87dad99daec4c81737287aa105b049
BLAKE2b-256 efc4733e403de752ac612e209d41d1b6b2daa5aca8c8c9513e4d0d5a23e2994e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 614.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8dd1be827d25e1ed7ac732b33065c988ea30053841092154c1cd6ed3c7166496
MD5 90410b2dc6b8859be8caf2b6f86f5c08
BLAKE2b-256 a6cb80bb617bf791a549cfe2bef1fae9df1411c784cff0fd5aca048f4eb43348

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 555.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 ca48052a4ccf2a4afe0405c6860e42a8c193638c2c49ce8d3974bf438f883f95
MD5 2ea2e605ed22fc06f43e0295048c9584
BLAKE2b-256 e4f72fe0c32ec367510d91fbc862246818daf6c48cc3b78b429aa7612d1677d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 395e4fd9e2e2e0e4cc1fb8ac23a54958cdc2cb1a7fb356b434f186bc8a8b515c
MD5 18525f153b3b376b4ec1b4f7ea03201a
BLAKE2b-256 7c6789061bd4e3e834e1a59e9acab9e36c290b2d111662db837ba5bb7907fdb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 616.1 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bab5aec31c8277dbcdc56abbee3247998899b19d677c74574c792d9566b8e4f9
MD5 fb2217f58b242fd35a8d59eae559f6ac
BLAKE2b-256 adfeb0ef1b7b93dc0c967d7919e6ede637ccdf666f2546f22ca8e7a16a7ca324

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 608.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fe7ff62bf2baed403e30f73ac83e85e178b7db283ba84d18952b5884694bbb27
MD5 4feed3309da7584df0ac81b14faf42d8
BLAKE2b-256 1ef559afdfcf04f93fd55e7d4021aca740a57dfcad42fcfd95348eccabb39b5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 549.9 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 514917a8051fe3c545708b827f806a37a7f3e3a940729ae900173a30a2f67709
MD5 106995dee5893cc0379e6064ef32c920
BLAKE2b-256 8588b9a93e2d467c66998c5d4e597ab02866dc2d1b9d2271ad535ff9946ce078

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 08f5ea34c37ad81282a3775cc91216e74cb751dcc985acc8526b5d93e34c5a07
MD5 6473048af525377806aea6ed05a798a6
BLAKE2b-256 8803c0bce8b746193123e40215b0648112de671e2f93bcbc0502c7f699c69b0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 611.4 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fcb122c0dc3a23f0f7b89878639a9efb7e3e4285b5b38491853a63d2bb0fb10f
MD5 4434c344ea0699b44f088b77e0ce1757
BLAKE2b-256 b796484230837f7424c6604d441c25dd754170d5d5d0a123a0a31160290d6b04

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pmdarima-1.7.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6bd31edf4dc87186f423733bb926c45ae0ec9348e6dd41fd025b4d9a7a3f072a
MD5 c4ff2e4699a9f9ce134a8ed2f92fc522
BLAKE2b-256 06ad10683bde89a98f1d97138b585b206502c34841e59edc8105dd937d74b1d8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pmdarima-1.7.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 53d27df5a0632b6b3f7ab1ac10433b2c60e0d579b7ec4a91b2b4824d6d1ba7b9
MD5 7b8276540899af797f6c16ee4dd1a7b2
BLAKE2b-256 5fd0f1b40c248083c5db09d7a6f3ffee3086b3507eb7bbf023169eda223f8892

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ffb88689427241c436795fad0aed3e80288d3c414ebb82937390512c2746a88b
MD5 052a2570e579c5378ce300407cf7d37a
BLAKE2b-256 be62725b3b6ae0e56c77534de5a8139322e7b863ca53fd5bd6bd3b7de87d0c20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 610.9 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for pmdarima-1.7.1-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f18dc0feb19493342225a9813e57d781332f27d856aa2616c1512693700269f6
MD5 b74f546ec36da62f5bb5ab0949f2b729
BLAKE2b-256 76473656b9705653f23ebe024a5eee240ebab44f5bcce6a9a24da8c25108cdfe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 604.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.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pmdarima-1.7.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9408f6ef2b9e1fafc0277f9d67fb9167095994b3f300be7b58dd90863dd28d1e
MD5 f81efcd2c5a568ee97c3a1e5ef129de8
BLAKE2b-256 c1f3845f1e6cd64a2147e0a70579689eaf9b6c98311abf3026ca77535b7b97bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 547.4 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.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pmdarima-1.7.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 291a1555f082a9e66cfe8fd732d3aeee97b6779e64788d5f43802828c531fef6
MD5 e4671ca5a7c8a66996d68809cee30843
BLAKE2b-256 633fe5c31c27a7ee37163ad079da6bdc2fac58077dbe29fdfd2bddc704a41fd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pmdarima-1.7.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 77805ece7c837dadb95b8e372f4fa24f28e8e98c02f8bce3a0bc22cc5e08a7c9
MD5 3c0c3c60090647ed842059e5c3ec4314
BLAKE2b-256 cec3c5d45350718dfaefb815d03aa61165dfc157d58368adff845f855e206114

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.1-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 605.3 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.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9

File hashes

Hashes for pmdarima-1.7.1-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2c96fb848270ee04428728399065c8835383e0796bee9c848f4c88bf85e83a53
MD5 5f2a36c4e13312f6b40194f0bd094bf8
BLAKE2b-256 f21eefe3d92a84b3c7afb1f1636ecb7230772bf10db4f58733e1823ef5d1a7fa

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